Bånder

SyncAlbumJob extends BaseJob
in package
implements ShouldQueue uses Dispatchable, InteractsWithQueue, Queueable, SerializesModels, UpdatesAlbumMetadata

Table of Contents

Interfaces

ShouldQueue

Properties

$albumId  : int
$cascade  : bool
$forceUpdate  : bool
$logger  : LoggerInterface
$loggerCache  : array<string|int, mixed>
$progressCurrentChunk  : int
Internal variable used for tracking chunking progress.
$progressLastUpdated  : int|null
The unix timestamp explaining the last time a progress has been written to database.
$sources  : array<string|int, mixed>

Methods

__construct()  : mixed
backoff()  : array<string|int, mixed>
Calculate the number of seconds to wait before retrying the job.
handle()  : void
keepMonitorOnSuccess()  : bool
Weather to keep successful monitor models. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. You are free to use the Laravel built-in failed job procedures.
progressCooldown()  : int
The time in seconds to wait before a following queue progress update will be issued.
queueData()  : void
Set Monitor data.
queueProgress()  : void
Update progress.
queueProgressChunk()  : void
Automatically update the current progress in each chunk iteration.
syncAll()  : self
syncFromDiscogs()  : self
syncFromMusicBrainz()  : self
syncGeneral()  : self
syncIdentifierBased()  : self
timeout()  : int
Determine the time at which the job should timeout.
tries()  : int
Determine the number of times the job may be attempted.
deleteQueueMonitor()  : void
Delete Queue Monitor object.
getLogger()  : mixed
getQueueMonitor()  : QueueMonitor|null
Return Queue Monitor Model.
extractYear()  : int|null
fetchDataFromSource()  : array<string|int, mixed>|null
fetchFromDiscogs()  : array<string|int, mixed>|null
fetchFromGeneral()  : array<string|int, mixed>|null
fetchFromMusicBrainz()  : array<string|int, mixed>|null
getAlbumFieldMappings()  : array<string|int, mixed>
getLogChannelAttribute()  : LogChannel|null
handleModernSync()  : void
hasIdentifierFields()  : bool
isHigherQualityAlbumData()  : bool
isQueueProgressOnCooldown()  : bool
Check if the monitor should skip writing the progress to database avoiding rapid update queries.
processComplexAlbumFields()  : array<string|int, mixed>
scheduleIdentifierBasedSync()  : void
shouldInitializeLogger()  : bool
shouldUpdateAlbumField()  : bool
syncFromSource()  : array<string|int, mixed>
updateAlbumMetadata()  : array<string|int, mixed>

Properties

$forceUpdate read-only

private bool $forceUpdate = false

$logger

private LoggerInterface $logger
Attributes
#[LogChannel]
$channel: \App\Modules\Logging\Channel::Metadata

$loggerCache

private array<string|int, mixed> $loggerCache = []

$progressCurrentChunk

Internal variable used for tracking chunking progress.

private int $progressCurrentChunk = 0

$progressLastUpdated

The unix timestamp explaining the last time a progress has been written to database.

private int|null $progressLastUpdated

$sources read-only

private array<string|int, mixed> $sources = ['general']

Methods

__construct()

public __construct(int $albumId[, bool $forceUpdate = false ][, array<string|int, mixed> $sources = ['general'] ][, bool $cascade = true ]) : mixed
Parameters
$albumId : int
$forceUpdate : bool = false
$sources : array<string|int, mixed> = ['general']
$cascade : bool = true

backoff()

Calculate the number of seconds to wait before retrying the job.

public backoff() : array<string|int, mixed>
Return values
array<string|int, mixed>

keepMonitorOnSuccess()

Weather to keep successful monitor models. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. You are free to use the Laravel built-in failed job procedures.

public static keepMonitorOnSuccess() : bool
Return values
bool

progressCooldown()

The time in seconds to wait before a following queue progress update will be issued.

public progressCooldown() : int

This is used to avoid writing many progress updates to the database. 0 = no delay.

Return values
int

queueData()

Set Monitor data.

public queueData(array<string|int, mixed> $data[, bool $merge = false ]) : void
Parameters
$data : array<string|int, mixed>

Custom data

$merge : bool = false

Merge the data instead of overriding

queueProgress()

Update progress.

public queueProgress(int $progress) : void
Parameters
$progress : int

Progress as integer 0-100

queueProgressChunk()

Automatically update the current progress in each chunk iteration.

public queueProgressChunk(int $collectionCount, int $perChunk) : void
Parameters
$collectionCount : int

The total collection item amount

$perChunk : int

The size of each chunk

syncAll()

public static syncAll(int $albumId[, bool $forceUpdate = false ]) : self
Parameters
$albumId : int
$forceUpdate : bool = false
Return values
self

syncFromDiscogs()

public static syncFromDiscogs(int $albumId[, bool $forceUpdate = false ]) : self
Parameters
$albumId : int
$forceUpdate : bool = false
Return values
self

syncFromMusicBrainz()

public static syncFromMusicBrainz(int $albumId[, bool $forceUpdate = false ]) : self
Parameters
$albumId : int
$forceUpdate : bool = false
Return values
self

syncGeneral()

public static syncGeneral(int $albumId[, bool $forceUpdate = false ]) : self
Parameters
$albumId : int
$forceUpdate : bool = false
Return values
self

syncIdentifierBased()

public static syncIdentifierBased(int $albumId[, bool $forceUpdate = false ]) : self
Parameters
$albumId : int
$forceUpdate : bool = false
Return values
self

timeout()

Determine the time at which the job should timeout.

public timeout() : int
Return values
int

tries()

Determine the number of times the job may be attempted.

public tries() : int
Return values
int

deleteQueueMonitor()

Delete Queue Monitor object.

protected deleteQueueMonitor() : void

extractYear()

private extractYear(mixed $date) : int|null
Parameters
$date : mixed
Return values
int|null

fetchDataFromSource()

private fetchDataFromSource(Album $album, string $source) : array<string|int, mixed>|null
Parameters
$album : Album
$source : string
Return values
array<string|int, mixed>|null

fetchFromDiscogs()

private fetchFromDiscogs(Album $album) : array<string|int, mixed>|null
Parameters
$album : Album
Return values
array<string|int, mixed>|null

fetchFromGeneral()

private fetchFromGeneral(Album $album) : array<string|int, mixed>|null
Parameters
$album : Album
Return values
array<string|int, mixed>|null

fetchFromMusicBrainz()

private fetchFromMusicBrainz(Album $album) : array<string|int, mixed>|null
Parameters
$album : Album
Return values
array<string|int, mixed>|null

getAlbumFieldMappings()

private getAlbumFieldMappings(string $source) : array<string|int, mixed>
Parameters
$source : string
Return values
array<string|int, mixed>

getLogChannelAttribute()

private getLogChannelAttribute(ReflectionProperty $property) : LogChannel|null
Parameters
$property : ReflectionProperty
Return values
LogChannel|null

hasIdentifierFields()

private hasIdentifierFields(array<string|int, mixed> $fields) : bool
Parameters
$fields : array<string|int, mixed>
Return values
bool

isHigherQualityAlbumData()

private isHigherQualityAlbumData(mixed $existing, mixed $new) : bool
Parameters
$existing : mixed
$new : mixed
Return values
bool

isQueueProgressOnCooldown()

Check if the monitor should skip writing the progress to database avoiding rapid update queries.

private isQueueProgressOnCooldown(int $progress) : bool

The progress values 0, 25, 50, 75 and 100 will always be written.

Parameters
$progress : int
Return values
bool

processComplexAlbumFields()

private processComplexAlbumFields(Album $album, array<string|int, mixed> $data, string $source) : array<string|int, mixed>
Parameters
$album : Album
$data : array<string|int, mixed>
$source : string
Return values
array<string|int, mixed>

scheduleIdentifierBasedSync()

private scheduleIdentifierBasedSync(Album $album) : void
Parameters
$album : Album

shouldInitializeLogger()

private shouldInitializeLogger(ReflectionProperty $property) : bool
Parameters
$property : ReflectionProperty
Return values
bool

shouldUpdateAlbumField()

private shouldUpdateAlbumField(Album $album, string $field, mixed $value) : bool
Parameters
$album : Album
$field : string
$value : mixed
Return values
bool

syncFromSource()

private syncFromSource(Album $album, string $source) : array<string|int, mixed>
Parameters
$album : Album
$source : string
Return values
array<string|int, mixed>

updateAlbumMetadata()

private updateAlbumMetadata(Album $album, array<string|int, mixed> $data, string $source) : array<string|int, mixed>
Parameters
$album : Album
$data : array<string|int, mixed>
$source : string
Return values
array<string|int, mixed>

        
On this page

Search results