2009-06-01 09:55:11 +00:00
|
|
|
# Created By: Virgil Dupras
|
|
|
|
# Created On: 2009-05-21
|
2010-01-01 20:11:34 +00:00
|
|
|
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
#
|
2010-09-30 10:17:41 +00:00
|
|
|
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
2009-08-05 08:59:46 +00:00
|
|
|
# which should be included with this package. The terms are also available at
|
2010-09-30 10:17:41 +00:00
|
|
|
# http://www.hardcoded.net/licenses/bsd_license
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2011-01-13 10:29:01 +00:00
|
|
|
from core_me import data, scanner, fs, __version__
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2010-10-04 13:29:00 +00:00
|
|
|
from ..base.app import DupeGuru as DupeGuruBase
|
|
|
|
from .details_dialog import DetailsDialog
|
|
|
|
from .preferences import Preferences
|
|
|
|
from .preferences_dialog import PreferencesDialog
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
class DupeGuru(DupeGuruBase):
|
2010-04-07 16:04:58 +00:00
|
|
|
EDITION = 'me'
|
2009-06-01 09:55:11 +00:00
|
|
|
LOGO_NAME = 'logo_me'
|
|
|
|
NAME = 'dupeGuru Music Edition'
|
2011-01-13 10:29:01 +00:00
|
|
|
VERSION = __version__
|
2010-08-13 07:26:38 +00:00
|
|
|
DELTA_COLUMNS = frozenset([2, 3, 4, 5, 7])
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
def __init__(self):
|
2010-09-29 14:49:50 +00:00
|
|
|
DupeGuruBase.__init__(self, data)
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
def _setup(self):
|
|
|
|
self.scanner = scanner.ScannerME()
|
2010-12-29 12:17:30 +00:00
|
|
|
self.directories.fileclasses = [fs.MusicFile]
|
2009-06-01 09:55:11 +00:00
|
|
|
DupeGuruBase._setup(self)
|
|
|
|
|
|
|
|
def _update_options(self):
|
|
|
|
DupeGuruBase._update_options(self)
|
|
|
|
self.scanner.min_match_percentage = self.prefs.filter_hardness
|
|
|
|
self.scanner.scan_type = self.prefs.scan_type
|
|
|
|
self.scanner.word_weighting = self.prefs.word_weighting
|
|
|
|
self.scanner.match_similar_words = self.prefs.match_similar
|
|
|
|
scanned_tags = set()
|
|
|
|
if self.prefs.scan_tag_track:
|
|
|
|
scanned_tags.add('track')
|
|
|
|
if self.prefs.scan_tag_artist:
|
|
|
|
scanned_tags.add('artist')
|
|
|
|
if self.prefs.scan_tag_album:
|
|
|
|
scanned_tags.add('album')
|
|
|
|
if self.prefs.scan_tag_title:
|
|
|
|
scanned_tags.add('title')
|
|
|
|
if self.prefs.scan_tag_genre:
|
|
|
|
scanned_tags.add('genre')
|
|
|
|
if self.prefs.scan_tag_year:
|
|
|
|
scanned_tags.add('year')
|
|
|
|
self.scanner.scanned_tags = scanned_tags
|
|
|
|
|
|
|
|
def _create_details_dialog(self, parent):
|
|
|
|
return DetailsDialog(parent, self)
|
|
|
|
|
|
|
|
def _create_preferences(self):
|
|
|
|
return Preferences()
|
|
|
|
|
|
|
|
def _create_preferences_dialog(self, parent):
|
|
|
|
return PreferencesDialog(parent, self)
|
|
|
|
|