mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-20 18:45:32 +01:00
Added ability to remove extras, Various Artists excluded from pre-processing, updated templates
This commit is contained in:
@@ -13,7 +13,11 @@
|
||||
%else:
|
||||
<li><a href="pauseArtist?ArtistID=${artist['ArtistID']}">Pause Artist</a></li>
|
||||
%endif
|
||||
<li><a href="getExtras?ArtistID=${artist['ArtistID']}">Get Extras</a></li>
|
||||
%if artist['IncludeExtras']:
|
||||
<li><a href="removeExtras?ArtistID=${artist['ArtistID']}">Remove Extras</a></li>
|
||||
%else:
|
||||
<li><a href="getExtras?ArtistID=${artist['ArtistID']}">Get Extras</a></li>
|
||||
%endif
|
||||
</ul>
|
||||
</div>
|
||||
</%def>
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
%else:
|
||||
<li><a href="pauseArtist?ArtistID=${artist['ArtistID']}">Pause Artist</a></li>
|
||||
%endif
|
||||
<li><a href="getExtras?ArtistID=${artist['ArtistID']}">Get Extras</a></li>
|
||||
%if artist['IncludeExtras']:
|
||||
<li><a href="removeExtras?ArtistID=${artist['ArtistID']}">Remove Extras</a></li>
|
||||
%else:
|
||||
<li><a href="getExtras?ArtistID=${artist['ArtistID']}">Get Extras</a></li>
|
||||
%endif
|
||||
</ul>
|
||||
</div>
|
||||
</%def>
|
||||
|
||||
@@ -435,6 +435,9 @@ def verifyresult(title, term):
|
||||
|
||||
title = re.sub('[\.\-\/\_]', ' ', title)
|
||||
|
||||
if term == 'Various Artists':
|
||||
return True
|
||||
|
||||
if not re.search('^' + re.escape(term), title, re.IGNORECASE):
|
||||
logger.info("Removed from results: " + title + " (artist not at string start).")
|
||||
return False
|
||||
|
||||
@@ -85,6 +85,18 @@ class WebInterface(object):
|
||||
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID)
|
||||
getExtras.exposed = True
|
||||
|
||||
def removeExtras(self, ArtistID):
|
||||
myDB = db.DBConnection()
|
||||
controlValueDict = {'ArtistID': ArtistID}
|
||||
newValueDict = {'IncludeExtras': 0}
|
||||
myDB.upsert("artists", newValueDict, controlValueDict)
|
||||
extraalbums = myDB.select('SELECT AlbumID from albums WHERE ArtistID=? AND Type!="Album"', [ArtistID])
|
||||
for album in extraalbums:
|
||||
myDB.action('DELETE from tracks WHERE ArtistID=? AND AlbumID=?', [ArtistID, album['AlbumID']])
|
||||
myDB.action('DELETE from albums WHERE ArtistID=? AND AlbumID=?', [ArtistID, album['AlbumID']])
|
||||
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID)
|
||||
removeExtras.exposed = True
|
||||
|
||||
def pauseArtist(self, ArtistID):
|
||||
logger.info(u"Pausing artist: " + ArtistID)
|
||||
myDB = db.DBConnection()
|
||||
|
||||
Reference in New Issue
Block a user