PHP 클래스 App\services\Media

파일 보기 프로젝트 열기: phanan/koel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allTags array Note that each isn't necessarily a valid ID3 tag name.
$tags array Tags to be synced.

공개 메소드들

메소드 설명
__construct ( )
gatherFiles ( string $path ) : array Gather all applicable files in a given directory.
getHash ( $path ) : string Generate a unique hash for a file path.
setTags ( array $tags = [] ) Construct an array of tags to be synced into the database from an input array of tags.
sync ( string | null $path = null, array $tags = [], boolean $force = false, SyncMedia $syncCommand = null ) Sync the media. Oh sync the media.
syncByWatchRecord ( App\Libraries\WatchRecord\WatchRecordInterface $record, SyncMedia $syncCommand = null ) Sync media using a watch record.
tidy ( ) Tidy up the library by deleting empty albums and artists.

메소드 상세

__construct() 공개 메소드

public __construct ( )

gatherFiles() 공개 메소드

Gather all applicable files in a given directory.
public gatherFiles ( string $path ) : array
$path string The directory's full path
리턴 array An array of SplFileInfo objects

getHash() 공개 메소드

Generate a unique hash for a file path.
public getHash ( $path ) : string
$path
리턴 string

setTags() 공개 메소드

If the input array is empty or contains only invalid items, we use all tags. Otherwise, we only use the valid items in it.
public setTags ( array $tags = [] )
$tags array

sync() 공개 메소드

Sync the media. Oh sync the media.
public sync ( string | null $path = null, array $tags = [], boolean $force = false, SyncMedia $syncCommand = null )
$path string | null
$tags array The tags to sync. Only taken into account for existing records. New records will have all tags synced in regardless.
$force boolean Whether to force syncing even unchanged files
$syncCommand App\Console\Commands\SyncMedia The SyncMedia command object, to log to console if executed by artisan.

syncByWatchRecord() 공개 메소드

Sync media using a watch record.
public syncByWatchRecord ( App\Libraries\WatchRecord\WatchRecordInterface $record, SyncMedia $syncCommand = null )
$record App\Libraries\WatchRecord\WatchRecordInterface The watch record.
$syncCommand App\Console\Commands\SyncMedia The SyncMedia command object, to log to console if executed by artisan.

tidy() 공개 메소드

Tidy up the library by deleting empty albums and artists.
public tidy ( )

프로퍼티 상세

$allTags 보호되어 있는 프로퍼티

Note that each isn't necessarily a valid ID3 tag name.
protected array $allTags
리턴 array

$tags 보호되어 있는 프로퍼티

Tags to be synced.
protected array $tags
리턴 array