RB.RhythmDBImportJob

g GObject.GInterface GObject.GInterface RB.TaskProgress RB.TaskProgress GObject.GInterface->RB.TaskProgress GObject.Object GObject.Object RB.RhythmDBImportJob RB.RhythmDBImportJob GObject.Object->RB.RhythmDBImportJob RB.TaskProgress->RB.RhythmDBImportJob

Subclasses:

None

Methods

Inherited:

GObject.Object (37), RB.TaskProgress (1)

Structs:

GObject.ObjectClass (5)

class

new (db, entry_type, ignore_type, error_type)

add_uri (uri)

cancel ()

complete ()

get_imported ()

get_processed ()

get_total ()

includes_uri (uri)

scan_complete ()

start ()

Virtual Methods

Inherited:

GObject.Object (7), RB.TaskProgress (1)

do_complete (total)

do_entry_added (entry)

do_scan_complete (total)

do_status_changed (total, imported)

Properties

Inherited:

RB.TaskProgress (6)

Name

Type

Flags

Short Description

db

RB.RhythmDB

r/w/co

RB.RhythmDB object

entry-type

RB.RhythmDBEntryType

r/w/co

Entry type to use for entries added by this job

error-type

RB.RhythmDBEntryType

r/w/co

Entry type to use for import error entries added by this job

ignore-type

RB.RhythmDBEntryType

r/w/co

Entry type to use for ignored entries added by this job

Signals

Inherited:

GObject.Object (1)

Name

Short Description

complete

Emitted when the whole import job is complete.

entry-added

Emitted when an entry has been added to the database by the import job.

scan-complete

Emitted when the directory scan is complete.

status-changed

Emitted when the status of the import job has changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.RhythmDBImportJob(**kwargs)
Bases:

GObject.Object, RB.TaskProgress

Abstract:

No

Structure:

RB.RhythmDBImportJobClass

classmethod new(db, entry_type, ignore_type, error_type)
Parameters:
Returns:

new RB.RhythmDBImportJob object.

Return type:

RB.RhythmDBImportJob

Creates a new import job with the specified entry types. Before starting the job, the caller must add one or more paths to import.

add_uri(uri)
Parameters:

uri (str) – the URI to import

Adds a URI to import. All files under the specified URI will be imported.

cancel()

Cancels the import job. The job will cease as soon as possible. More directories may be scanned and more files may be imported before the job actually ceases.

complete()
Returns:

True if complete.

Return type:

bool

Returns whether the import job is complete.

get_imported()
Returns:

file count

Return type:

int

Returns the number of files successfully imported by the import job so far.

get_processed()
Returns:

file count

Return type:

int

Returns the number of files processed by the import job so far.

get_total()
Returns:

the total number of files to be processed

Return type:

int

Returns the total number of files that will be processed by this import job. This increases as the import directories are scanned.

includes_uri(uri)
Parameters:

uri (str) – a URI to check

Returns:

True if the import job includes the URI

Return type:

bool

Checks if the specified URI is included in the import job.

scan_complete()
Returns:

True if complete

Return type:

bool

Returns whether the directory scan phase of the import job is complete.

start()

Starts the import job. After this method has been called, no more URIs may be added to the import job. May only be called once for a given import job.

do_complete(total) virtual
Parameters:

total (int) –

do_entry_added(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_scan_complete(total) virtual
Parameters:

total (int) –

do_status_changed(total, imported) virtual
Parameters:
  • total (int) –

  • imported (int) –

Signal Details

RB.RhythmDBImportJob.signals.complete(rhythm_d_b_import_job, total)
Signal Name:

complete

Flags:

RUN_LAST

Parameters:
  • rhythm_d_b_import_job (RB.RhythmDBImportJob) – The object which received the signal

  • total (int) – the number of items imported.

Emitted when the whole import job is complete.

RB.RhythmDBImportJob.signals.entry_added(rhythm_d_b_import_job, entry)
Signal Name:

entry-added

Flags:

RUN_LAST

Parameters:

Emitted when an entry has been added to the database by the import job.

RB.RhythmDBImportJob.signals.scan_complete(rhythm_d_b_import_job, total)
Signal Name:

scan-complete

Flags:

RUN_LAST

Parameters:
  • rhythm_d_b_import_job (RB.RhythmDBImportJob) – The object which received the signal

  • total (int) – the number of items scanned.

Emitted when the directory scan is complete. Once the scan is complete, the total number of files to be processed will not change.

RB.RhythmDBImportJob.signals.status_changed(rhythm_d_b_import_job, total, imported)
Signal Name:

status-changed

Flags:

RUN_LAST

Parameters:
  • rhythm_d_b_import_job (RB.RhythmDBImportJob) – The object which received the signal

  • total (int) – the current total number of files to process

  • imported (int) – the current count of files imported

Emitted when the status of the import job has changed.

Property Details

RB.RhythmDBImportJob.props.db
Name:

db

Type:

RB.RhythmDB

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

RB.RhythmDB object

RB.RhythmDBImportJob.props.entry_type
Name:

entry-type

Type:

RB.RhythmDBEntryType

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Entry type to use for entries added by this job

RB.RhythmDBImportJob.props.error_type
Name:

error-type

Type:

RB.RhythmDBEntryType

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Entry type to use for import error entries added by this job

RB.RhythmDBImportJob.props.ignore_type
Name:

ignore-type

Type:

RB.RhythmDBEntryType

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Entry type to use for ignored entries added by this job