mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 12:49:26 +00:00
Port over the existing track information (location, bit rate, format) from the tracks table to the alltracks table - based on TrackID. Updated album.html to use jquery and autoreload the track table, fixed the 'There was a error' typo in script.s
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
else:
|
||||
alternate_album_name = alternate_album['AlbumTitle'] + " (" + alternate_album['ReleaseCountry'] + ", " + alternate_album['ReleaseFormat'] + ")"
|
||||
%>
|
||||
<a href="switchAlbum?AlbumID=${album['AlbumID']}&ReleaseID=${alternate_album['ReleaseID']}">${alternate_album_name}</a><br>
|
||||
<a href="#" onclick="doAjaxCall('switchAlbum?AlbumID=${album['AlbumID']}&ReleaseID=${alternate_album['ReleaseID']}', $(this), 'table');" data-success="Switched release to: ${alternate_album_name}">${alternate_album_name}</a><br>
|
||||
%endfor
|
||||
%endif
|
||||
</div>
|
||||
|
||||
@@ -257,7 +257,7 @@ function doAjaxCall(url,elem,reload,form) {
|
||||
var dataError = $(elem).data('error');
|
||||
if (typeof dataError === "undefined") {
|
||||
// Standard Message when variable is not set
|
||||
var dataError = "There was a error";
|
||||
var dataError = "There was an error";
|
||||
}
|
||||
// Get Success & Error message from inline data, else use standard message
|
||||
var succesMsg = $("<div class='msg'><span class='ui-icon ui-icon-check'></span>" + dataSucces + "</div>");
|
||||
|
||||
@@ -173,6 +173,9 @@ def addArtisttoDB(artistid, extrasonly=False):
|
||||
fullreleaselist = []
|
||||
|
||||
for release in releaselist:
|
||||
# What we're doing here now is first updating the allalbums & alltracks table to the most
|
||||
# current info, then moving the appropriate release into the album table and its associated
|
||||
# tracks into the tracks table
|
||||
|
||||
releaseid = release['id']
|
||||
|
||||
@@ -296,6 +299,20 @@ def addArtisttoDB(artistid, extrasonly=False):
|
||||
if not rg_exists:
|
||||
releaseid = rg['id']
|
||||
elif rg_exists and not rg_exists['ReleaseID']:
|
||||
# Need to do some importing here - to transition the old format of using the release group
|
||||
# only to using releasegroup & releaseid. These are the albums that are missing a ReleaseID
|
||||
# so we'll need to move over the locations, bitrates & formats from the tracks table to the new
|
||||
# alltracks table. Thankfully we can just use TrackIDs since they span releases/releasegroups
|
||||
logger.info("Copying current track information to alternate releases")
|
||||
tracks = myDB.action('SELECT * from tracks WHERE AlbumID=?', [rg['id']]).fetchall()
|
||||
for track in tracks:
|
||||
if track['Location']:
|
||||
controlValueDict = {"TrackID": track['TrackID']}
|
||||
newValueDict = {"Location": track['Location'],
|
||||
"BitRate": track['BitRate'],
|
||||
"Format": track['Format'],
|
||||
}
|
||||
myDB.upsert("alltracks", newValueDict, controlValueDict)
|
||||
releaseid = rg['id']
|
||||
else:
|
||||
releaseid = rg_exists['ReleaseID']
|
||||
|
||||
Reference in New Issue
Block a user