Property | Type | Description | |
---|---|---|---|
$getID3 | getID\getID3 | The getID3 object, for ID3 tag reading. | |
$hash | string | This value is unique, and can be used to query a Song record. | |
$mtime | integer | The file's last modified time. | |
$path | string | The file's path. | |
$song | The song model that's associated with this file. | ||
$splFileInfo | SplFileInf\SplFileInfo | The SplFileInfo object of the file. | |
$syncError | string | The last parsing error text, if any. |
Method | Description | |
---|---|---|
__construct ( string | SplFileInf\SplFileInfo $path, getID\getID3 $getID3 = null ) | Construct our File object. | |
getGetID3 ( ) : getID\getID3 | ||
getHash ( string $path ) : string | Get a unique hash from a file path. | |
getInfo ( ) : array | void | Get all applicable ID3 info from the file. | |
getPath ( ) : string | ||
getSyncError ( ) : syncError | Get the last parsing error's text. | |
isChanged ( ) : boolean | Determine if the file is changed (its Song record is found, but the timestamp is different). | |
isNew ( ) : boolean | Determine if the file is new (its Song record can't be found in the database). | |
isNewOrChanged ( ) : boolean | Determine if the file is new or changed. | |
setGetID3 ( getID\getID3 $getID3 = null ) | ||
sync ( array $tags, boolean $force = false ) : boolean | |
Sync the song with all available media info against the database. |
Method | Description | |
---|---|---|
getCoverFileUnderSameDirectory ( ) : string | false | Issue #380. |
public __construct ( string | SplFileInf\SplFileInfo $path, getID\getID3 $getID3 = null ) | ||
$path | string | SplFileInf\SplFileInfo | Either the file's path, or a SplFileInfo object |
$getID3 | getID\getID3 | A getID3 object for DI (and better performance) |
public getSyncError ( ) : syncError | ||
return | syncError |
public isNewOrChanged ( ) : boolean | ||
return | boolean |
public sync ( array $tags, boolean $force = false ) : boolean | |
||
$tags | array | The (selective) tags to sync (if the song exists) |
$force | boolean | Whether to force syncing, even if the file is unchanged |
return | boolean | |
A Song object on success, true if file exists but is unmodified, or false on an error. |
protected getID3,getID $getID3 | ||
return | getID\getID3 |
protected string $hash | ||
return | string |
protected Song,app\models $song | ||
return |
protected SplFileInfo,SplFileInf $splFileInfo | ||
return | SplFileInf\SplFileInfo |
protected string $syncError | ||
return | string |