mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-20 18:45:32 +01:00
Added ability to delete single history items
This commit is contained in:
@@ -1236,6 +1236,7 @@ div#artistheader h2 a {
|
||||
position: relative;
|
||||
top: 7px;
|
||||
}
|
||||
#trashcan {margin-top:15px;}
|
||||
.cloudtag {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<th id="size">Size</th>
|
||||
<th id="status">Status</th>
|
||||
<th id="action"></th>
|
||||
<th id="delete"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -54,6 +55,7 @@
|
||||
<td id="size">${helpers.bytes_to_mb(item['Size'])}</td>
|
||||
<td id="status">${item['Status']}</td>
|
||||
<td id="action">[<a href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${item['AlbumID']}&redirect=history', $(this),'table')" data-success="Retrying download of '${item['Title']}'">retry</a>][<a href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${item['AlbumID']}&new=True&redirect=history',$(this),'table')" data-success="Looking for a new version of '${item['Title']}'">new</a>]</td>
|
||||
<td id="delete"><a href="#" onclick="doAjaxCall('clearhistory?date_added=${item['DateAdded']}&title=${item['Title']}',$(this),'table')" data-success="${item['Title']} cleared from history"><img src="interfaces/default/images/trashcan.png" height="18" width="18" id="trashcan" title="Clear this item from the history"></a>
|
||||
</tr>
|
||||
%endfor
|
||||
</tbody>
|
||||
|
||||
BIN
data/interfaces/default/images/trashcan.png
Normal file
BIN
data/interfaces/default/images/trashcan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -843,14 +843,18 @@ class WebInterface(object):
|
||||
return json_albums
|
||||
getAlbumsByArtist_json.exposed=True
|
||||
|
||||
def clearhistory(self, type=None):
|
||||
def clearhistory(self, type=None, date_added=None, title=None):
|
||||
myDB = db.DBConnection()
|
||||
if type == 'all':
|
||||
logger.info(u"Clearing all history")
|
||||
myDB.action('DELETE from snatched')
|
||||
if type:
|
||||
if type == 'all':
|
||||
logger.info(u"Clearing all history")
|
||||
myDB.action('DELETE from snatched')
|
||||
else:
|
||||
logger.info(u"Clearing history where status is %s" % type)
|
||||
myDB.action('DELETE from snatched WHERE Status=?', [type])
|
||||
else:
|
||||
logger.info(u"Clearing history where status is %s" % type)
|
||||
myDB.action('DELETE from snatched WHERE Status=?', [type])
|
||||
logger.info(u"Deleting '%s' from history" % title)
|
||||
myDB.action('DELETE from snatched WHERE Title=? AND DateAdded=?', [title, date_added])
|
||||
raise cherrypy.HTTPRedirect("history")
|
||||
clearhistory.exposed = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user