Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Several fixes to get the import running. Import Artist so that the pr…

…ocessing algorithm can run, fix method signatures inside class to avoid a "takes at most N arguments (N+1 given)" problem, and whole-ass the half-ass dictionary.
  • Loading branch information...
commit 0a1e89fb2bf327e1a6a1d238944dae3779dfb8ce 1 parent e464392
Jake Billo authored

Showing 2 changed files with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +5 5 musik/library/importer.py
  2. +2 2 musik/util.py
10 musik/library/importer.py
@@ -8,7 +8,7 @@
8 8 from mutagen.mp3 import MP3
9 9
10 10 from musik import initLogging
11   -from musik.db import DatabaseWrapper, ImportTask, Track, Album
  11 +from musik.db import DatabaseWrapper, ImportTask, Track, Album, Artist
12 12 from musik.util import EasygoingDictionary
13 13
14 14 class ImportThread(threading.Thread):
@@ -149,7 +149,7 @@ def readMp3MetaData(self, uri):
149 149
150 150 track = Track(uri)
151 151 track.artist = self.findArtist(metadata['artist'], metadata['artistsort'], metadata['musicbrainz_artistid'])
152   - track.album_artist = self.findArtist(metadata['albumartistsort'], metadata['albumartistsort'])
  152 + track.album_artist = self.findArtist(metadata['albumartist'], metadata['albumartistsort'])
153 153 track.arranger = self.findArtist(metadata['arranger'])
154 154 track.composer = self.findArtist(metadata['composer'], metadata['composersort'])
155 155 track.conductor = self.findArtist(metadata['conductor'])
@@ -163,7 +163,7 @@ def readMp3MetaData(self, uri):
163 163 return track
164 164
165 165
166   - def findArtist(name=None, name_sort=None, musicbrainz_id=None):
  166 + def findArtist(self, name=None, name_sort=None, musicbrainz_id=None):
167 167 """Searches the database for an existing artist that matches the specified criteria.
168 168 If no existing artist can be found, a new artist is created with the criteria
169 169 """
@@ -212,7 +212,7 @@ def findArtist(name=None, name_sort=None, musicbrainz_id=None):
212 212 return artist
213 213
214 214
215   - def findAlbum(title=None, title_sort=None, musicbrainz_id=None, artist=None, metadata=None):
  215 + def findAlbum(self, title=None, title_sort=None, musicbrainz_id=None, artist=None, metadata=None):
216 216 """Searches the database for an existing album that matches the specified criteria.
217 217 If no existing album can be found, a new album is created with the criteria.
218 218 """
@@ -313,7 +313,7 @@ def findAlbum(title=None, title_sort=None, musicbrainz_id=None, artist=None, met
313 313 return album
314 314
315 315
316   - def findDisc(album=None, discnumber=None, discsubtitle=None, musicbrainz_id=None):
  316 + def findDisc(self, album=None, discnumber=None, discsubtitle=None, musicbrainz_id=None):
317 317 """Tries to find an existing disc that matches the specified criteria.
318 318 If an existing disc cannot be found, creates a new disc with the specified criteria.
319 319 """
4 musik/util.py
@@ -2,6 +2,6 @@ class EasygoingDictionary(dict):
2 2 """A dictionary that returns None if you try to access a non-existent key.
3 3 """
4 4 def __getitem__(self, key):
5   - if not self.has_key(key):
  5 + if not key in self:
6 6 return None
7   - return super(Index,self).__getitem__(key)
  7 + return super(EasygoingDictionary, self).__getitem__(key)

0 comments on commit 0a1e89f

Please sign in to comment.
Something went wrong with that request. Please try again.