From 40fe0cde151d0c4e06343ad8710a7541aede6bfd Mon Sep 17 00:00:00 2001 From: Ade Date: Sat, 22 Mar 2014 21:04:32 +1300 Subject: [PATCH] Stop album being deleted and re-inserted as wanted on refresh if status set --- headphones/importer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/headphones/importer.py b/headphones/importer.py index b78c69ab..a7481f76 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -224,8 +224,14 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False): #Make a user configurable variable to skip update of albums with release dates older than this date (in days) pause_delta = headphones.MB_IGNORE_AGE + check_release_date = myDB.action("SELECT ReleaseDate, Status from albums WHERE ArtistID=? AND AlbumTitle=?", (artistid, al_title)).fetchone() + + #Skip update if Status set + if check_release_date and check_release_date[1]: + logger.info("[%s] Not updating: %s (Status is %s, skipping)" % (artist['artist_name'], rg['title'], check_release_date[1])) + continue + if not forcefull: - check_release_date = myDB.action("SELECT ReleaseDate from albums WHERE ArtistID=? AND AlbumTitle=?", (artistid, al_title)).fetchone() if check_release_date: if check_release_date[0] is None: logger.info("[%s] Now updating: %s (No Release Date)" % (artist['artist_name'], rg['title']))