mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Added Location column to track database and album template
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
<th id="number">#</th>
|
<th id="number">#</th>
|
||||||
<th id="name">Track Title</th>
|
<th id="name">Track Title</th>
|
||||||
<th id="duration">Duration</th>
|
<th id="duration">Duration</th>
|
||||||
<th id="have"></th>
|
<th id="location"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -61,13 +61,11 @@
|
|||||||
%for track in tracks:
|
%for track in tracks:
|
||||||
<%
|
<%
|
||||||
i += 1
|
i += 1
|
||||||
have = myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ? AND TrackTitle like ?', [track['ArtistName'], track['AlbumTitle'], track['TrackTitle']])
|
if track['Location']:
|
||||||
if len(have):
|
|
||||||
grade = 'A'
|
grade = 'A'
|
||||||
check = '<img src="images/checkmark.png" alt="checkmark">'
|
|
||||||
else:
|
else:
|
||||||
grade = 'Z'
|
grade = 'Z'
|
||||||
check = ''
|
|
||||||
try:
|
try:
|
||||||
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
|
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
|
||||||
except:
|
except:
|
||||||
@@ -77,7 +75,7 @@
|
|||||||
<td id="number">${i}</td>
|
<td id="number">${i}</td>
|
||||||
<td id="name">${track['TrackTitle']}</td>
|
<td id="name">${track['TrackTitle']}</td>
|
||||||
<td id="duration">${trackduration}</td>
|
<td id="duration">${trackduration}</td>
|
||||||
<td id="have">${check}</td>
|
<td id="location">${track['Location']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
%endfor
|
%endfor
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ def dbcheck():
|
|||||||
c=conn.cursor()
|
c=conn.cursor()
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS artists (ArtistID TEXT UNIQUE, ArtistName TEXT, ArtistSortName TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, LatestAlbum TEXT, ReleaseDate TEXT, AlbumID TEXT, HaveTracks INTEGER, TotalTracks INTEGER)')
|
c.execute('CREATE TABLE IF NOT EXISTS artists (ArtistID TEXT UNIQUE, ArtistName TEXT, ArtistSortName TEXT, DateAdded TEXT, Status TEXT, IncludeExtras INTEGER, LatestAlbum TEXT, ReleaseDate TEXT, AlbumID TEXT, HaveTracks INTEGER, TotalTracks INTEGER)')
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS albums (ArtistID TEXT, ArtistName TEXT, AlbumTitle TEXT, AlbumASIN TEXT, ReleaseDate TEXT, DateAdded TEXT, AlbumID TEXT UNIQUE, Status TEXT, Type TEXT)')
|
c.execute('CREATE TABLE IF NOT EXISTS albums (ArtistID TEXT, ArtistName TEXT, AlbumTitle TEXT, AlbumASIN TEXT, ReleaseDate TEXT, DateAdded TEXT, AlbumID TEXT UNIQUE, Status TEXT, Type TEXT)')
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS tracks (ArtistID TEXT, ArtistName TEXT, AlbumTitle TEXT, AlbumASIN TEXT, AlbumID TEXT, TrackTitle TEXT, TrackDuration, TrackID TEXT, TrackNumber INTEGER)')
|
c.execute('CREATE TABLE IF NOT EXISTS tracks (ArtistID TEXT, ArtistName TEXT, AlbumTitle TEXT, AlbumASIN TEXT, AlbumID TEXT, TrackTitle TEXT, TrackDuration, TrackID TEXT, TrackNumber INTEGER, Location TEXT)')
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS snatched (AlbumID TEXT, Title TEXT, Size INTEGER, URL TEXT, DateAdded TEXT, Status TEXT, FolderName TEXT)')
|
c.execute('CREATE TABLE IF NOT EXISTS snatched (AlbumID TEXT, Title TEXT, Size INTEGER, URL TEXT, DateAdded TEXT, Status TEXT, FolderName TEXT)')
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS have (ArtistName TEXT, AlbumTitle TEXT, TrackNumber TEXT, TrackTitle TEXT, TrackLength TEXT, BitRate TEXT, Genre TEXT, Date TEXT, TrackID TEXT)')
|
c.execute('CREATE TABLE IF NOT EXISTS have (ArtistName TEXT, AlbumTitle TEXT, TrackNumber TEXT, TrackTitle TEXT, TrackLength TEXT, BitRate TEXT, Genre TEXT, Date TEXT, TrackID TEXT)')
|
||||||
c.execute('CREATE TABLE IF NOT EXISTS lastfmcloud (ArtistName TEXT, ArtistID TEXT, Count INTEGER)')
|
c.execute('CREATE TABLE IF NOT EXISTS lastfmcloud (ArtistName TEXT, ArtistID TEXT, Count INTEGER)')
|
||||||
@@ -489,7 +489,12 @@ def dbcheck():
|
|||||||
try:
|
try:
|
||||||
c.execute('SELECT FolderName from snatched')
|
c.execute('SELECT FolderName from snatched')
|
||||||
except sqlite3.OperationalError:
|
except sqlite3.OperationalError:
|
||||||
c.execute('ALTER TABLE snatched ADD COLUMN FolderName TEXT')
|
c.execute('ALTER TABLE snatched ADD COLUMN FolderName TEXT')
|
||||||
|
|
||||||
|
try:
|
||||||
|
c.execute('SELECT Location from tracks')
|
||||||
|
except sqlite3.OperationalError:
|
||||||
|
c.execute('ALTER TABLE tracks ADD COLUMN Location TEXT')
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
c.close()
|
c.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user