Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanner: Switch to gst.pbutils.Discoverer and refactor API #538

Merged
merged 2 commits into from Oct 20, 2013

Conversation

adamcik
Copy link
Member

@adamcik adamcik commented Oct 20, 2013

  • New API wraps gst.pbutils.Discoverer for mopidy use.
    • Custom scanner code removed.
  • Callback based async API switched with simpler synchronous API
    • Scanner is feed one and one URI and returns the result or raises an error.
  • Adds new ScannerError exception for error handling in scanner
  • Limits local/scan_timeout to 1000-3600000 i.e. 1s to 1h
  • Files with zero duration are now excluded.
  • Mtime handling moved out of scanner so we can use it for streams etc.

Also fixes slowest tests found in #534 and paves the way for making the stream backend lookup metadata.

- New API wraps gst.pbutils.Discoverer for mopidy use.
  - Custom scanner code removed.
- Callback based async API switched with simpler synchronous API
  - Scanner is feed one and one URI and returns the result or raises an error.
- Adds new ScannerError exception for error handling in scanner
- Limits local/scan_timeout to 1000-3600000 i.e. 1s to 1h
- Files with zero duration are now excluded.
- Mtime handling moved out of scanner so we can use it for streams etc.

from mopidy import config as config_lib, ext
from mopidy import config as config_lib, ext, exceptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort imports

- Move ScannerError to exceptions module.
- Subclass ScannerError from MopidyException.
- Fix import sorting.
@@ -2,6 +2,7 @@

import unittest

from mopidy import exceptions
from mopidy.scanner import Scanner, translator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort imports :-)

(moved comment from commit to PR)

jodal added a commit that referenced this pull request Oct 20, 2013
scanner: Switch to gst.pbutils.Discoverer and refactor API
@jodal jodal merged commit e6712ba into mopidy:develop Oct 20, 2013
@ghost ghost assigned jodal Oct 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants