Class LightMediaScanner::Scanner
In: rdoc.c
Parent: Object

LightMediaScanner::Scanner is a class to represent a LightMediaScanner instance.

Methods

Public Class methods

Scanner#new

constructor

Public Instance methods

Scanner::add_charset

Register a new charset encoding to be used.

Throws a RuntimeError if LMS is unable to add the charset.

  • p1 (charset) charset name as understood by iconv_open(3).
  • return charset

Scanner::check

Check consistency of the given directory.

  • p1 (top_path) The top directory to scan.
  • return 0 on success

Scanner::commit_interval

Get the number of files served between database transactions.

  • return The number of files served between database transactions

Scanner::commit_interval=

Set the number of files to be served between database transactions.

  • p1 (transactions) The number of files between commits
  • return The new number of files to be served between database transactions

Scanner::db_path

Accessor for LMS DB path.

  • return The database path given at creation time

Scanner::process

This will add or update media found in the given directory or its children.

  • p1 (top_path) The top directory to scan.
  • return 0 on success

Scanner::processing?

Checks if Light Media Scanner is being used in a processing operation like lms_process() or lms_check().

  • return Boolean representing the instance‘s processing state

Scanner::remove_charset

Forget about a registered charset encoding.

Throws a RuntimeError if LMS is unable to remove the charset.

  • p1 (charset) charset name as understood by iconv_open(3).
  • return charset

Scanner::timeout

Get the maximum amount of milliseconds the slave can take to serve one file.

If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.

  • return The timeout in milliseconds, or -1 on error

Scanner::timeout=

Set the maximum amount of milliseconds the slave can take to serve one file.

If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.

  • p1 (timeout_ms) The timeout in milliseconds
  • return The new timeout, in milliseconds

[Validate]