| 57 | } |
| 58 | |
| 59 | function existing_duration( $path ) { |
| 60 | global $existing_programming; |
| 61 | |
| 62 | if ( ! $existing_programming ) { |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | if ( isset( $existing_programming->content_index->{ $path } ) && isset( $existing_programming->content_index->{ $path }->duration ) ) { |
| 67 | // echo "Found " . $path . "\n"; |
| 68 | return $existing_programming->content_index->{ $path }->duration; |
| 69 | } else if ( isset( $existing_programming->ad_index->{ $path } ) && isset( $existing_programming->ad_index->{ $path }->duration ) ) { |
| 70 | // echo "Found ad " . $path . "\n"; |
| 71 | return $existing_programming->ad_index->{ $path }->duration; |
| 72 | } else { |
| 73 | // echo "Didn't find " . $path . "\n"; |
| 74 | } |
| 75 | |
| 76 | return false; |
| 77 | } |
| 78 | |
| 79 | foreach ( $lines as $line ) { |
| 80 | // Remove comments. |