-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsequence.php
More file actions
executable file
·26 lines (20 loc) · 810 Bytes
/
sequence.php
File metadata and controls
executable file
·26 lines (20 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php declare(strict_types = 1);
include_once __DIR__ . '/vendor/autoload.php';
use steinmb\scanner\Scanner;
use steinmb\scanner\Playlist;
if (count($argv) !== 3) {
echo 'Usage: php sequence.php <directory to scan> <comma separated list of mpls tracks>' . PHP_EOL;
echo 'Example: php sequence.php /Volumes/HACKERS/BDMV/PLAYLIST "00506, 00500, 00001, 00502"' . PHP_EOL;
exit;
}
$directoryToScan = $argv[1];
$playlist = new Playlist($directoryToScan);
if (!$playlist->numberOfValidFiles()) {
echo 'Found no files to analyze. ' . PHP_EOL;
exit;
}
echo 'Found: ' . $playlist->numberOfValidFiles() . ' mpls tracks to analyze.' . PHP_EOL;
$string = str_replace(' ', '', $argv[2]);
$sequence = explode(',', $string);
$scanner = new Scanner($playlist, $sequence);
$scanner->searchSequence();