1 | <?php |
||
17 | class Media |
||
18 | { |
||
19 | /** |
||
20 | * All applicable tags in a media file that we cater for. |
||
21 | * Note that each isn't necessarily a valid ID3 tag name. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $allTags = [ |
||
26 | 'artist', |
||
27 | 'album', |
||
28 | 'title', |
||
29 | 'length', |
||
30 | 'track', |
||
31 | 'lyrics', |
||
32 | 'cover', |
||
33 | 'mtime', |
||
34 | 'compilation', |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * Tags to be synced. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $tags = []; |
||
43 | |||
44 | /** |
||
45 | * Sync the media. Oh sync the media. |
||
46 | * |
||
47 | * @param string|null $mediaPath |
||
48 | * @param array $tags The tags to sync. |
||
49 | * Only taken into account for existing records. |
||
50 | * New records will have all tags synced in regardless. |
||
51 | * @param bool $force Whether to force syncing even unchanged files |
||
52 | * @param SyncMedia $syncCommand The SyncMedia command object, to log to console if executed by artisan. |
||
53 | */ |
||
54 | public function sync($mediaPath = null, $tags = [], $force = false, SyncMedia $syncCommand = null) |
||
104 | |||
105 | /** |
||
106 | * Gather all applicable files in a given directory. |
||
107 | * |
||
108 | * @param string $path The directory's full path |
||
109 | * |
||
110 | * @return array An array of SplFileInfo objects |
||
111 | */ |
||
112 | public function gatherFiles($path) |
||
124 | |||
125 | /** |
||
126 | * Sync media using a watch record. |
||
127 | * |
||
128 | * @param WatchRecordInterface $record The watch record. |
||
129 | */ |
||
130 | public function syncByWatchRecord(WatchRecordInterface $record) |
||
135 | |||
136 | /** |
||
137 | * Sync a file's watch record. |
||
138 | * |
||
139 | * @param WatchRecordInterface $record |
||
140 | */ |
||
141 | private function syncFileRecord(WatchRecordInterface $record) |
||
167 | |||
168 | /** |
||
169 | * Sync a directory's watch record. |
||
170 | * |
||
171 | * @param WatchRecordInterface $record |
||
172 | */ |
||
173 | private function syncDirectoryRecord(WatchRecordInterface $record) |
||
196 | |||
197 | /** |
||
198 | * Construct an array of tags to be synced into the database from an input array of tags. |
||
199 | * If the input array is empty or contains only invalid items, we use all tags. |
||
200 | * Otherwise, we only use the valid items in it. |
||
201 | * |
||
202 | * @param array $tags |
||
203 | */ |
||
204 | public function setTags($tags = []) |
||
213 | |||
214 | /** |
||
215 | * Generate a unique hash for a file path. |
||
216 | * |
||
217 | * @param $path |
||
218 | * |
||
219 | * @return string |
||
220 | */ |
||
221 | public function getHash($path) |
||
225 | |||
226 | /** |
||
227 | * Tidy up the library by deleting empty albums and artists. |
||
228 | */ |
||
229 | public function tidy() |
||
248 | } |
||
249 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.