Bånder

SyncArtistJob extends BaseJob
in package
implements ShouldQueue uses Dispatchable, InteractsWithQueue, Queueable, SerializesModels, UpdatesArtistMetadata

Table of Contents

Interfaces

ShouldQueue

Properties

$artistId  : 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
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
deleteQueueMonitor()  : void
Delete Queue Monitor object.
getFieldMappings()  : array<string|int, mixed>
getLogger()  : LoggerInterface
getQueueMonitor()  : QueueMonitor|null
Return Queue Monitor Model.
processComplexFields()  : array<string|int, mixed>
fetchDataFromSource()  : array<string|int, mixed>|null
fetchFromDiscogs()  : array<string|int, mixed>|null
fetchFromGeneral()  : array<string|int, mixed>|null
fetchFromMusicBrainz()  : array<string|int, mixed>|null
getLogChannelAttribute()  : LogChannel|null
hasIdentifierFields()  : bool
isHigherQualityData()  : bool
isQueueProgressOnCooldown()  : bool
Check if the monitor should skip writing the progress to database avoiding rapid update queries.
scheduleIdentifierBasedSync()  : void
shouldInitializeLogger()  : bool
shouldUpdateField()  : bool
syncFromSource()  : array<string|int, mixed>
updateArtistMetadata()  : array<string|int, mixed>

Properties

$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 $artistId[, bool $forceUpdate = false ][, array<string|int, mixed> $sources = ['general'] ][, bool $cascade = true ]) : mixed
Parameters
$artistId : int
$forceUpdate : bool = false
$sources : array<string|int, mixed> = ['general']
$cascade : bool = true

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 $artistId[, bool $forceUpdate = false ]) : self
Parameters
$artistId : int
$forceUpdate : bool = false
Return values
self

syncFromDiscogs()

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

syncFromMusicBrainz()

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

syncGeneral()

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

syncIdentifierBased()

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

deleteQueueMonitor()

Delete Queue Monitor object.

protected deleteQueueMonitor() : void

getFieldMappings()

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

getLogger()

protected getLogger([string $propertyName = 'logger' ]) : LoggerInterface
Parameters
$propertyName : string = 'logger'
Return values
LoggerInterface

processComplexFields()

protected processComplexFields(Artist $artist, array<string|int, mixed> $data, string $source) : array<string|int, mixed>
Parameters
$artist : Artist
$data : array<string|int, mixed>
$source : string
Return values
array<string|int, mixed>

fetchDataFromSource()

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

fetchFromDiscogs()

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

fetchFromGeneral()

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

fetchFromMusicBrainz()

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

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

isHigherQualityData()

private isHigherQualityData(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

shouldInitializeLogger()

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

shouldUpdateField()

private shouldUpdateField(Artist $artist, string $field, mixed $value) : bool
Parameters
$artist : Artist
$field : string
$value : mixed
Return values
bool

syncFromSource()

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

updateArtistMetadata()

private updateArtistMetadata(Artist $artist, array<string|int, mixed> $data, string $source) : array<string|int, mixed>
Parameters
$artist : Artist
$data : array<string|int, mixed>
$source : string
Return values
array<string|int, mixed>

        
On this page

Search results