Added album-chooser to the interface, fixed some backend bugs

This commit is contained in:
rembo10
2012-08-14 21:46:13 +05:30
parent ceea8977e8
commit 144076c03d
3 changed files with 35 additions and 9 deletions
+27 -2
View File
@@ -1,5 +1,5 @@
<%inherit file="base.html" />
<%!
<%!
from headphones import db, helpers
myDB = db.DBConnection()
%>
@@ -16,7 +16,28 @@
%else:
<a id="menu_link_retry" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False', $(this),true);" data-success="Retrying the same version of '${album['AlbumTitle']}'">Retry Download</a>
<a id="menu_link_new" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True', $(this),true);" data-success="Looking for a new version of '${album['AlbumTitle']}'">Try New Version</a>
%endif
%endif
<a class="menu_link_edit" id="album_chooser" href="#">Choose Alternate Version</a>
<div id="dialog" title="Choose an Alternate Release" style="display:none" class="configtable">
<div class="links">
<%
alternate_albums = myDB.select("SELECT * from allalbums WHERE AlbumID=?", [album['AlbumID']])
%>
%if not alternate_albums:
<p>No alternate versions found. Try refreshing the artist</p>
%else:
%for alternate_album in alternate_albums:
<%
if alternate_album['AlbumID'] == alternate_album['ReleaseID']:
alternate_album_name = "Headphones Default Release"
else:
alternate_album_name = alternate_album['AlbumTitle'] + " (" + alternate_album['ReleaseCountry'] + ", " + alternate_album['ReleaseFormat'] + ")"
%>
<a href="switchAlbum?AlbumID=${album['AlbumID']}&ReleaseID=${alternate_albums['ReleaseID']}">${alternate_album_name}</a><br>
%endfor
%endif
</div>
</div>
</div>
</div>
<a href="artistPage?ArtistID=${album['ArtistID']}" class="back">&laquo; Back to ${album['ArtistName']}</a>
@@ -144,6 +165,10 @@
}
$(document).ready(function() {
$('#album_chooser').click(function() {
$('#dialog').dialog();
return false;
});
getAlbumInfo();
getAlbumArt();
initActions();