diff --git a/cleanup.py b/cleanup.py index 3012914..326ff6a 100644 --- a/cleanup.py +++ b/cleanup.py @@ -1,6 +1,6 @@ import re import utilities -from doreah import tsv +from doreah import tsv, settings # need to do this as a class so it can retain loaded settings from file # apparently this is not true @@ -52,6 +52,9 @@ class CleanerAgent: def parseArtists(self,a): + if a.strip() in settings.get_settings("INVALID_ARTISTS"): + return [] + if a.strip() == "": return [] diff --git a/database.py b/database.py index cfcd54c..fe44ba7 100644 --- a/database.py +++ b/database.py @@ -111,6 +111,10 @@ def get_track_dict(o): def createScrobble(artists,title,time,volatile=False): + + if len(artists) == 0 or title == "": + return {} + dblock.acquire() i = getTrackID(artists,title) diff --git a/settings/default.ini b/settings/default.ini index 30be3a2..b795299 100644 --- a/settings/default.ini +++ b/settings/default.ini @@ -24,6 +24,7 @@ TRACK_SEARCH_PROVIDER = None [Database] DB_CACHE_SIZE = 8192 # how many MB on disk each database cache should have available. +INVALID_ARTISTS = ["[Unknown Artist]","Unknown Artist"] [Local Images]