Rename filename to url, change album_id to string and recreate songs tables (#182)
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
<file>schema/schema-5.sql</file>
|
<file>schema/schema-5.sql</file>
|
||||||
<file>schema/schema-6.sql</file>
|
<file>schema/schema-6.sql</file>
|
||||||
<file>schema/schema-7.sql</file>
|
<file>schema/schema-7.sql</file>
|
||||||
|
<file>schema/schema-8.sql</file>
|
||||||
<file>schema/device-schema.sql</file>
|
<file>schema/device-schema.sql</file>
|
||||||
<file>style/strawberry.css</file>
|
<file>style/strawberry.css</file>
|
||||||
<file>html/playing-tooltip-plain.html</file>
|
<file>html/playing-tooltip-plain.html</file>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ CREATE TABLE device_%deviceid_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -40,7 +40,7 @@ CREATE TABLE device_%deviceid_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|||||||
595
data/schema/schema-8.sql
Normal file
595
data/schema/schema-8.sql
Normal file
@@ -0,0 +1,595 @@
|
|||||||
|
ALTER TABLE songs RENAME TO songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE playlist_items RENAME TO playlist_items_old;
|
||||||
|
|
||||||
|
ALTER TABLE tidal_artists_songs RENAME TO tidal_artists_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE tidal_albums_songs RENAME TO tidal_albums_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE tidal_songs RENAME TO tidal_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE qobuz_artists_songs RENAME TO qobuz_artists_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE qobuz_albums_songs RENAME TO qobuz_albums_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE qobuz_songs RENAME TO qobuz_songs_old;
|
||||||
|
|
||||||
|
ALTER TABLE subsonic_songs RENAME TO subsonic_songs_old;
|
||||||
|
|
||||||
|
DROP INDEX idx_filename;
|
||||||
|
|
||||||
|
CREATE TABLE songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE tidal_artists_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE tidal_albums_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE tidal_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE subsonic_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE qobuz_artists_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE qobuz_albums_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE qobuz_songs (
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER NOT NULL,
|
||||||
|
url TEXT NOT NULL,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
ctime INTEGER NOT NULL DEFAULT 0,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE playlist_items (
|
||||||
|
|
||||||
|
playlist INTEGER NOT NULL,
|
||||||
|
type INTEGER NOT NULL DEFAULT 0,
|
||||||
|
collection_id INTEGER,
|
||||||
|
playlist_url TEXT,
|
||||||
|
|
||||||
|
title TEXT NOT NULL,
|
||||||
|
album TEXT NOT NULL,
|
||||||
|
artist TEXT NOT NULL,
|
||||||
|
albumartist TEXT NOT NULL,
|
||||||
|
track INTEGER NOT NULL DEFAULT -1,
|
||||||
|
disc INTEGER NOT NULL DEFAULT -1,
|
||||||
|
year INTEGER NOT NULL DEFAULT -1,
|
||||||
|
originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
genre TEXT NOT NULL,
|
||||||
|
compilation INTEGER NOT NULL DEFAULT -1,
|
||||||
|
composer TEXT NOT NULL,
|
||||||
|
performer TEXT NOT NULL,
|
||||||
|
grouping TEXT NOT NULL,
|
||||||
|
comment TEXT NOT NULL,
|
||||||
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
album_id TEXT NOT NULL,
|
||||||
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
|
length INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
bitrate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
samplerate INTEGER NOT NULL DEFAULT 0,
|
||||||
|
bitdepth INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
|
directory_id INTEGER,
|
||||||
|
url TEXT,
|
||||||
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
|
filesize INTEGER,
|
||||||
|
mtime INTEGER,
|
||||||
|
ctime INTEGER,
|
||||||
|
unavailable INTEGER DEFAULT 0,
|
||||||
|
|
||||||
|
playcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
skipcount INTEGER NOT NULL DEFAULT 0,
|
||||||
|
lastplayed INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
compilation_detected INTEGER DEFAULT 0,
|
||||||
|
compilation_on INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_off INTEGER NOT NULL DEFAULT 0,
|
||||||
|
compilation_effective INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
art_automatic TEXT,
|
||||||
|
art_manual TEXT,
|
||||||
|
|
||||||
|
effective_albumartist TEXT,
|
||||||
|
effective_originalyear INTEGER NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
cue_path TEXT
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM songs_old;
|
||||||
|
|
||||||
|
DROP TABLE songs_old;
|
||||||
|
|
||||||
|
INSERT INTO tidal_artists_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM tidal_artists_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE tidal_artists_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO tidal_albums_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM tidal_albums_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE tidal_albums_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO tidal_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM tidal_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE tidal_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO qobuz_artists_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM qobuz_artists_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE qobuz_artists_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO qobuz_albums_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM qobuz_albums_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE qobuz_albums_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO qobuz_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM qobuz_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE qobuz_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO subsonic_songs (title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM subsonic_songs_old;
|
||||||
|
|
||||||
|
DROP TABLE subsonic_songs_old;
|
||||||
|
|
||||||
|
INSERT INTO playlist_items (playlist, type, collection_id, playlist_url, title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path)
|
||||||
|
SELECT playlist, type, collection_id, url, title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, artist_id, album_id, song_id, beginning, length, bitrate, samplerate, bitdepth, source, directory_id, filename, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path
|
||||||
|
FROM playlist_items_old;
|
||||||
|
|
||||||
|
DROP TABLE playlist_items_old;
|
||||||
|
|
||||||
|
CREATE INDEX idx_url ON songs (url);
|
||||||
|
|
||||||
|
UPDATE schema_version SET version=8;
|
||||||
@@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS schema_version (
|
|||||||
|
|
||||||
DELETE FROM schema_version;
|
DELETE FROM schema_version;
|
||||||
|
|
||||||
INSERT INTO schema_version (version) VALUES (7);
|
INSERT INTO schema_version (version) VALUES (8);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS directories (
|
CREATE TABLE IF NOT EXISTS directories (
|
||||||
path TEXT NOT NULL,
|
path TEXT NOT NULL,
|
||||||
@@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -48,7 +48,7 @@ CREATE TABLE IF NOT EXISTS songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -93,7 +93,7 @@ CREATE TABLE IF NOT EXISTS tidal_artists_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -105,7 +105,7 @@ CREATE TABLE IF NOT EXISTS tidal_artists_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -150,7 +150,7 @@ CREATE TABLE IF NOT EXISTS tidal_albums_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -162,7 +162,7 @@ CREATE TABLE IF NOT EXISTS tidal_albums_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -207,7 +207,7 @@ CREATE TABLE IF NOT EXISTS tidal_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -219,7 +219,7 @@ CREATE TABLE IF NOT EXISTS tidal_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -264,7 +264,7 @@ CREATE TABLE IF NOT EXISTS subsonic_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -276,7 +276,7 @@ CREATE TABLE IF NOT EXISTS subsonic_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -321,7 +321,7 @@ CREATE TABLE IF NOT EXISTS qobuz_artists_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -333,7 +333,7 @@ CREATE TABLE IF NOT EXISTS qobuz_artists_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -378,7 +378,7 @@ CREATE TABLE IF NOT EXISTS qobuz_albums_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -390,7 +390,7 @@ CREATE TABLE IF NOT EXISTS qobuz_albums_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -435,7 +435,7 @@ CREATE TABLE IF NOT EXISTS qobuz_songs (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -447,7 +447,7 @@ CREATE TABLE IF NOT EXISTS qobuz_songs (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER NOT NULL,
|
directory_id INTEGER NOT NULL,
|
||||||
filename TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER NOT NULL DEFAULT 0,
|
filesize INTEGER NOT NULL DEFAULT 0,
|
||||||
mtime INTEGER NOT NULL DEFAULT 0,
|
mtime INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -489,7 +489,7 @@ CREATE TABLE IF NOT EXISTS playlist_items (
|
|||||||
playlist INTEGER NOT NULL,
|
playlist INTEGER NOT NULL,
|
||||||
type INTEGER NOT NULL DEFAULT 0,
|
type INTEGER NOT NULL DEFAULT 0,
|
||||||
collection_id INTEGER,
|
collection_id INTEGER,
|
||||||
url TEXT,
|
playlist_url TEXT,
|
||||||
|
|
||||||
title TEXT NOT NULL,
|
title TEXT NOT NULL,
|
||||||
album TEXT NOT NULL,
|
album TEXT NOT NULL,
|
||||||
@@ -508,7 +508,7 @@ CREATE TABLE IF NOT EXISTS playlist_items (
|
|||||||
lyrics TEXT NOT NULL,
|
lyrics TEXT NOT NULL,
|
||||||
|
|
||||||
artist_id INTEGER NOT NULL DEFAULT -1,
|
artist_id INTEGER NOT NULL DEFAULT -1,
|
||||||
album_id INTEGER NOT NULL DEFAULT -1,
|
album_id TEXT NOT NULL,
|
||||||
song_id INTEGER NOT NULL DEFAULT -1,
|
song_id INTEGER NOT NULL DEFAULT -1,
|
||||||
|
|
||||||
beginning INTEGER NOT NULL DEFAULT 0,
|
beginning INTEGER NOT NULL DEFAULT 0,
|
||||||
@@ -520,7 +520,7 @@ CREATE TABLE IF NOT EXISTS playlist_items (
|
|||||||
|
|
||||||
source INTEGER NOT NULL DEFAULT 0,
|
source INTEGER NOT NULL DEFAULT 0,
|
||||||
directory_id INTEGER,
|
directory_id INTEGER,
|
||||||
filename TEXT,
|
url TEXT,
|
||||||
filetype INTEGER NOT NULL DEFAULT 0,
|
filetype INTEGER NOT NULL DEFAULT 0,
|
||||||
filesize INTEGER,
|
filesize INTEGER,
|
||||||
mtime INTEGER,
|
mtime INTEGER,
|
||||||
@@ -556,7 +556,7 @@ CREATE TABLE IF NOT EXISTS devices (
|
|||||||
transcode_format NOT NULL DEFAULT 5
|
transcode_format NOT NULL DEFAULT 5
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_filename ON songs (filename);
|
CREATE INDEX IF NOT EXISTS idx_url ON songs (url);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_comp_artist ON songs (compilation_effective, artist);
|
CREATE INDEX IF NOT EXISTS idx_comp_artist ON songs (compilation_effective, artist);
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ void CollectionBackend::ChangeDirPath(int id, const QString &old_path, const QSt
|
|||||||
// Do the songs table
|
// Do the songs table
|
||||||
{
|
{
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
q.prepare(QString("UPDATE %1 SET filename=:path || substr(filename, %2) WHERE directory=:id").arg(songs_table_).arg(path_len));
|
q.prepare(QString("UPDATE %1 SET url=:path || substr(url, %2) WHERE directory=:id").arg(songs_table_).arg(path_len));
|
||||||
q.bindValue(":path", new_url);
|
q.bindValue(":path", new_url);
|
||||||
q.bindValue(":id", id);
|
q.bindValue(":id", id);
|
||||||
q.exec();
|
q.exec();
|
||||||
@@ -748,7 +748,7 @@ Song CollectionBackend::GetSongByUrl(const QUrl &url, qint64 beginning) {
|
|||||||
|
|
||||||
CollectionQuery query;
|
CollectionQuery query;
|
||||||
query.SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
query.SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
||||||
query.AddWhere("filename", url.toString());
|
query.AddWhere("url", url.toString());
|
||||||
query.AddWhere("beginning", beginning);
|
query.AddWhere("beginning", beginning);
|
||||||
|
|
||||||
Song song;
|
Song song;
|
||||||
@@ -763,7 +763,7 @@ SongList CollectionBackend::GetSongsByUrl(const QUrl &url) {
|
|||||||
|
|
||||||
CollectionQuery query;
|
CollectionQuery query;
|
||||||
query.SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
query.SetColumnSpec("%songs_table.ROWID, " + Song::kColumnSpec);
|
||||||
query.AddWhere("filename", url.toString());
|
query.AddWhere("url", url.toString());
|
||||||
|
|
||||||
SongList songlist;
|
SongList songlist;
|
||||||
if (ExecQuery(&query)) {
|
if (ExecQuery(&query)) {
|
||||||
@@ -860,7 +860,7 @@ void CollectionBackend::UpdateCompilations() {
|
|||||||
// Look for albums that have songs by more than one 'effective album artist' in the same directory
|
// Look for albums that have songs by more than one 'effective album artist' in the same directory
|
||||||
|
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
q.prepare(QString("SELECT effective_albumartist, album, filename, compilation_detected FROM %1 WHERE unavailable = 0 ORDER BY album").arg(songs_table_));
|
q.prepare(QString("SELECT effective_albumartist, album, url, compilation_detected FROM %1 WHERE unavailable = 0 ORDER BY album").arg(songs_table_));
|
||||||
q.exec();
|
q.exec();
|
||||||
if (db_->CheckErrors(q)) return;
|
if (db_->CheckErrors(q)) return;
|
||||||
|
|
||||||
@@ -948,7 +948,7 @@ CollectionBackend::AlbumList CollectionBackend::GetAlbums(const QString &artist,
|
|||||||
AlbumList ret;
|
AlbumList ret;
|
||||||
|
|
||||||
CollectionQuery query(opt);
|
CollectionQuery query(opt);
|
||||||
query.SetColumnSpec("album, artist, albumartist, compilation, compilation_detected, art_automatic, art_manual, filename");
|
query.SetColumnSpec("album, artist, albumartist, compilation, compilation_detected, art_automatic, art_manual, url");
|
||||||
query.SetOrderBy("album");
|
query.SetOrderBy("album");
|
||||||
|
|
||||||
if (compilation) {
|
if (compilation) {
|
||||||
@@ -1000,7 +1000,7 @@ CollectionBackend::Album CollectionBackend::GetAlbumArt(const QString &artist, c
|
|||||||
ret.album_artist = albumartist;
|
ret.album_artist = albumartist;
|
||||||
|
|
||||||
CollectionQuery query = CollectionQuery(QueryOptions());
|
CollectionQuery query = CollectionQuery(QueryOptions());
|
||||||
query.SetColumnSpec("art_automatic, art_manual, filename");
|
query.SetColumnSpec("art_automatic, art_manual, url");
|
||||||
if (!albumartist.isEmpty()) {
|
if (!albumartist.isEmpty()) {
|
||||||
query.AddWhere("albumartist", albumartist);
|
query.AddWhere("albumartist", albumartist);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1011,7 +1011,7 @@ CollectionItem *CollectionModel::ItemFromQuery(GroupBy type, bool signal, bool c
|
|||||||
item->key = row.value(0).toString();
|
item->key = row.value(0).toString();
|
||||||
item->display_text = TextOrUnknown(item->key);
|
item->display_text = TextOrUnknown(item->key);
|
||||||
item->sort_text = SortTextForArtist(item->key);
|
item->sort_text = SortTextForArtist(item->key);
|
||||||
item->metadata.set_album_id(row.value(1).toInt());
|
item->metadata.set_album_id(row.value(1).toString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GroupBy_OriginalYear:{
|
case GroupBy_OriginalYear:{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
#include "scopedtransaction.h"
|
#include "scopedtransaction.h"
|
||||||
|
|
||||||
const char *Database::kDatabaseFilename = "strawberry.db";
|
const char *Database::kDatabaseFilename = "strawberry.db";
|
||||||
const int Database::kSchemaVersion = 7;
|
const int Database::kSchemaVersion = 8;
|
||||||
const char *Database::kMagicAllSongsTables = "%allsongstables";
|
const char *Database::kMagicAllSongsTables = "%allsongstables";
|
||||||
|
|
||||||
int Database::sNextConnectionId = 1;
|
int Database::sNextConnectionId = 1;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const QStringList Song::kColumns = QStringList() << "title"
|
|||||||
|
|
||||||
<< "source"
|
<< "source"
|
||||||
<< "directory_id"
|
<< "directory_id"
|
||||||
<< "filename"
|
<< "url"
|
||||||
<< "filetype"
|
<< "filetype"
|
||||||
<< "filesize"
|
<< "filesize"
|
||||||
<< "mtime"
|
<< "mtime"
|
||||||
@@ -177,7 +177,7 @@ struct Song::Private : public QSharedData {
|
|||||||
QString lyrics_;
|
QString lyrics_;
|
||||||
|
|
||||||
qint64 artist_id_;
|
qint64 artist_id_;
|
||||||
qint64 album_id_;
|
QString album_id_;
|
||||||
qint64 song_id_;
|
qint64 song_id_;
|
||||||
|
|
||||||
qint64 beginning_;
|
qint64 beginning_;
|
||||||
@@ -230,7 +230,6 @@ Song::Private::Private(Song::Source source)
|
|||||||
compilation_(false),
|
compilation_(false),
|
||||||
|
|
||||||
artist_id_(-1),
|
artist_id_(-1),
|
||||||
album_id_(-1),
|
|
||||||
song_id_(-1),
|
song_id_(-1),
|
||||||
|
|
||||||
beginning_(0),
|
beginning_(0),
|
||||||
@@ -275,7 +274,7 @@ bool Song::is_unavailable() const { return d->unavailable_; }
|
|||||||
int Song::id() const { return d->id_; }
|
int Song::id() const { return d->id_; }
|
||||||
|
|
||||||
qint64 Song::artist_id() const { return d->artist_id_; }
|
qint64 Song::artist_id() const { return d->artist_id_; }
|
||||||
qint64 Song::album_id() const { return d->album_id_; }
|
QString Song::album_id() const { return d->album_id_; }
|
||||||
qint64 Song::song_id() const { return d->song_id_; }
|
qint64 Song::song_id() const { return d->song_id_; }
|
||||||
|
|
||||||
const QString &Song::title() const { return d->title_; }
|
const QString &Song::title() const { return d->title_; }
|
||||||
@@ -342,7 +341,8 @@ void Song::set_id(int id) { d->id_ = id; }
|
|||||||
void Song::set_valid(bool v) { d->valid_ = v; }
|
void Song::set_valid(bool v) { d->valid_ = v; }
|
||||||
|
|
||||||
void Song::set_artist_id(qint64 v) { d->artist_id_ = v; }
|
void Song::set_artist_id(qint64 v) { d->artist_id_ = v; }
|
||||||
void Song::set_album_id(qint64 v) { d->album_id_ = v; }
|
void Song::set_album_id(qint64 v) { d->album_id_ = QString::number(v); }
|
||||||
|
void Song::set_album_id(const QString &v) { d->album_id_ = v; }
|
||||||
void Song::set_song_id(qint64 v) { d->song_id_ = v; }
|
void Song::set_song_id(qint64 v) { d->song_id_ = v; }
|
||||||
|
|
||||||
void Song::set_title(const QString &v) { d->title_ = v; }
|
void Song::set_title(const QString &v) { d->title_ = v; }
|
||||||
@@ -774,7 +774,7 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
|||||||
d->artist_id_ = tolonglong(x);
|
d->artist_id_ = tolonglong(x);
|
||||||
}
|
}
|
||||||
else if (Song::kColumns.value(i) == "album_id") {
|
else if (Song::kColumns.value(i) == "album_id") {
|
||||||
d->album_id_ = tolonglong(x);
|
d->album_id_ = tostr(x);
|
||||||
}
|
}
|
||||||
else if (Song::kColumns.value(i) == "song_id") {
|
else if (Song::kColumns.value(i) == "song_id") {
|
||||||
d->song_id_ = tolonglong(x);
|
d->song_id_ = tolonglong(x);
|
||||||
@@ -803,7 +803,7 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
|||||||
else if (Song::kColumns.value(i) == "directory_id") {
|
else if (Song::kColumns.value(i) == "directory_id") {
|
||||||
d->directory_id_ = toint(x);
|
d->directory_id_ = toint(x);
|
||||||
}
|
}
|
||||||
else if (Song::kColumns.value(i) == "filename") {
|
else if (Song::kColumns.value(i) == "url") {
|
||||||
set_url(QUrl::fromEncoded(tostr(x).toUtf8()));
|
set_url(QUrl::fromEncoded(tostr(x).toUtf8()));
|
||||||
d->basefilename_ = QFileInfo(d->url_.toLocalFile()).fileName();
|
d->basefilename_ = QFileInfo(d->url_.toLocalFile()).fileName();
|
||||||
}
|
}
|
||||||
@@ -944,7 +944,8 @@ void Song::InitFromItdb(const Itdb_Track *track, const QString &prefix) {
|
|||||||
filename.replace(':', '/');
|
filename.replace(':', '/');
|
||||||
if (prefix.contains("://")) {
|
if (prefix.contains("://")) {
|
||||||
set_url(QUrl(prefix + filename));
|
set_url(QUrl(prefix + filename));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
set_url(QUrl::fromLocalFile(prefix + filename));
|
set_url(QUrl::fromLocalFile(prefix + filename));
|
||||||
}
|
}
|
||||||
d->basefilename_ = QFileInfo(filename).fileName();
|
d->basefilename_ = QFileInfo(filename).fileName();
|
||||||
@@ -1130,7 +1131,7 @@ void Song::BindToQuery(QSqlQuery *query) const {
|
|||||||
query->bindValue(":lyrics", strval(d->lyrics_));
|
query->bindValue(":lyrics", strval(d->lyrics_));
|
||||||
|
|
||||||
query->bindValue(":artist_id", intval(d->artist_id_));
|
query->bindValue(":artist_id", intval(d->artist_id_));
|
||||||
query->bindValue(":album_id", intval(d->album_id_));
|
query->bindValue(":album_id", strval(d->album_id_));
|
||||||
query->bindValue(":song_id", intval(d->song_id_));
|
query->bindValue(":song_id", intval(d->song_id_));
|
||||||
|
|
||||||
query->bindValue(":beginning", d->beginning_);
|
query->bindValue(":beginning", d->beginning_);
|
||||||
@@ -1152,7 +1153,7 @@ void Song::BindToQuery(QSqlQuery *query) const {
|
|||||||
url = d->url_.toEncoded();
|
url = d->url_.toEncoded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query->bindValue(":filename", url);
|
query->bindValue(":url", url);
|
||||||
|
|
||||||
query->bindValue(":filetype", d->filetype_);
|
query->bindValue(":filetype", d->filetype_);
|
||||||
query->bindValue(":filesize", notnullintval(d->filesize_));
|
query->bindValue(":filesize", notnullintval(d->filesize_));
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ class Song {
|
|||||||
const QString &lyrics() const;
|
const QString &lyrics() const;
|
||||||
|
|
||||||
qint64 artist_id() const;
|
qint64 artist_id() const;
|
||||||
qint64 album_id() const;
|
QString album_id() const;
|
||||||
qint64 song_id() const;
|
qint64 song_id() const;
|
||||||
|
|
||||||
qint64 beginning_nanosec() const;
|
qint64 beginning_nanosec() const;
|
||||||
@@ -291,6 +291,7 @@ class Song {
|
|||||||
|
|
||||||
void set_artist_id(qint64 v);
|
void set_artist_id(qint64 v);
|
||||||
void set_album_id(qint64 v);
|
void set_album_id(qint64 v);
|
||||||
|
void set_album_id(const QString &v);
|
||||||
void set_song_id(qint64 v);
|
void set_song_id(qint64 v);
|
||||||
|
|
||||||
void set_beginning_nanosec(qint64 v);
|
void set_beginning_nanosec(qint64 v);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ QStandardItem *InternetSearchModel::BuildContainers(const Song &s, QStandardItem
|
|||||||
bool has_album_icon = false;
|
bool has_album_icon = false;
|
||||||
QString display_text;
|
QString display_text;
|
||||||
QString sort_text;
|
QString sort_text;
|
||||||
int unique_tag = -1;
|
QString unique_tag;
|
||||||
int year = 0;
|
int year = 0;
|
||||||
|
|
||||||
switch (group_by_[level]) {
|
switch (group_by_[level]) {
|
||||||
@@ -222,7 +222,7 @@ QStandardItem *InternetSearchModel::BuildContainers(const Song &s, QStandardItem
|
|||||||
if (sort_text.isEmpty()) sort_text = "Unknown";
|
if (sort_text.isEmpty()) sort_text = "Unknown";
|
||||||
|
|
||||||
// Find a container for this level
|
// Find a container for this level
|
||||||
key->group_[level] = display_text + QString::number(unique_tag);
|
key->group_[level] = display_text + unique_tag;
|
||||||
QStandardItem *container = containers_[*key];
|
QStandardItem *container = containers_[*key];
|
||||||
if (!container) {
|
if (!container) {
|
||||||
container = new QStandardItem(display_text);
|
container = new QStandardItem(display_text);
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ void QobuzFavoriteRequest::AddFavorites(const FavoriteType type, const SongList
|
|||||||
id = QString::number(song.artist_id());
|
id = QString::number(song.artist_id());
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Albums:
|
case FavoriteType_Albums:
|
||||||
if (song.album_id() <= 0) continue;
|
if (song.album_id().isEmpty()) continue;
|
||||||
id = QString::number(song.album_id());
|
id = song.album_id();
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Songs:
|
case FavoriteType_Songs:
|
||||||
if (song.song_id() <= 0) continue;
|
if (song.song_id() <= 0) continue;
|
||||||
@@ -215,8 +215,8 @@ void QobuzFavoriteRequest::RemoveFavorites(const FavoriteType type, const SongLi
|
|||||||
id = QString::number(song.artist_id());
|
id = QString::number(song.artist_id());
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Albums:
|
case FavoriteType_Albums:
|
||||||
if (song.album_id() <= 0) continue;
|
if (song.album_id().isEmpty()) continue;
|
||||||
id = QString::number(song.album_id());
|
id = song.album_id();
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Songs:
|
case FavoriteType_Songs:
|
||||||
if (song.song_id() <= 0) continue;
|
if (song.song_id() <= 0) continue;
|
||||||
|
|||||||
@@ -1027,6 +1027,7 @@ int QobuzRequest::ParseSong(Song &song, const QJsonObject &json_obj, qint64 arti
|
|||||||
|
|
||||||
song.set_source(Song::Source_Qobuz);
|
song.set_source(Song::Source_Qobuz);
|
||||||
song.set_song_id(song_id);
|
song.set_song_id(song_id);
|
||||||
|
song.set_album_id(album_id);
|
||||||
song.set_artist_id(artist_id);
|
song.set_artist_id(artist_id);
|
||||||
song.set_album(album);
|
song.set_album(album);
|
||||||
song.set_artist(album_artist);
|
song.set_artist(album_artist);
|
||||||
|
|||||||
@@ -628,13 +628,13 @@ void SubsonicRequest::FlushAlbumCoverRequests() {
|
|||||||
|
|
||||||
QNetworkReply *reply = network_->get(req);
|
QNetworkReply *reply = network_->get(req);
|
||||||
album_cover_replies_ << reply;
|
album_cover_replies_ << reply;
|
||||||
NewClosure(reply, SIGNAL(finished()), this, SLOT(AlbumCoverReceived(QNetworkReply*, const qint64, const QUrl&, const QString&)), reply, request.album_id, request.url, request.filename);
|
NewClosure(reply, SIGNAL(finished()), this, SLOT(AlbumCoverReceived(QNetworkReply*, const QString&, const QUrl&, const QString&)), reply, request.album_id, request.url, request.filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsonicRequest::AlbumCoverReceived(QNetworkReply *reply, const qint64 album_id, const QUrl &url, const QString &filename) {
|
void SubsonicRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url, const QString &filename) {
|
||||||
|
|
||||||
if (album_cover_replies_.contains(reply)) {
|
if (album_cover_replies_.contains(reply)) {
|
||||||
album_cover_replies_.removeAll(reply);
|
album_cover_replies_.removeAll(reply);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class SubsonicRequest : public SubsonicBaseRequest {
|
|||||||
|
|
||||||
void AlbumsReplyReceived(QNetworkReply *reply, const int offset_requested);
|
void AlbumsReplyReceived(QNetworkReply *reply, const int offset_requested);
|
||||||
void AlbumSongsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const qint64 album_id, const QString &album_artist);
|
void AlbumSongsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const qint64 album_id, const QString &album_artist);
|
||||||
void AlbumCoverReceived(QNetworkReply *reply, const qint64 album_id, const QUrl &url, const QString &filename);
|
void AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url, const QString &filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef QPair<QString, QString> Param;
|
typedef QPair<QString, QString> Param;
|
||||||
@@ -85,7 +85,7 @@ class SubsonicRequest : public SubsonicBaseRequest {
|
|||||||
};
|
};
|
||||||
struct AlbumCoverRequest {
|
struct AlbumCoverRequest {
|
||||||
qint64 artist_id = 0;
|
qint64 artist_id = 0;
|
||||||
qint64 album_id = 0;
|
QString album_id = 0;
|
||||||
QUrl url;
|
QUrl url;
|
||||||
QString filename;
|
QString filename;
|
||||||
};
|
};
|
||||||
@@ -127,7 +127,7 @@ class SubsonicRequest : public SubsonicBaseRequest {
|
|||||||
QQueue<AlbumCoverRequest> album_cover_requests_queue_;
|
QQueue<AlbumCoverRequest> album_cover_requests_queue_;
|
||||||
|
|
||||||
QHash<int, Request> album_songs_requests_pending_;
|
QHash<int, Request> album_songs_requests_pending_;
|
||||||
QMultiMap<int, Song*> album_covers_requests_sent_;
|
QMultiMap<QString, Song*> album_covers_requests_sent_;
|
||||||
|
|
||||||
int albums_requests_active_;
|
int albums_requests_active_;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ TidalBaseRequest::~TidalBaseRequest() {
|
|||||||
QNetworkReply *TidalBaseRequest::CreateRequest(const QString &ressource_name, const QList<Param> ¶ms_provided) {
|
QNetworkReply *TidalBaseRequest::CreateRequest(const QString &ressource_name, const QList<Param> ¶ms_provided) {
|
||||||
|
|
||||||
ParamList params = ParamList() << params_provided
|
ParamList params = ParamList() << params_provided
|
||||||
<< Param("countryCode", country_code());
|
<< Param("countryCode", country_code());
|
||||||
|
|
||||||
QUrlQuery url_query;
|
QUrlQuery url_query;
|
||||||
for (const Param& param : params) {
|
for (const Param& param : params) {
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ void TidalFavoriteRequest::AddFavorites(const FavoriteType type, const SongList
|
|||||||
id = QString::number(song.artist_id());
|
id = QString::number(song.artist_id());
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Albums:
|
case FavoriteType_Albums:
|
||||||
if (song.album_id() <= 0) continue;
|
if (song.album_id().isEmpty()) continue;
|
||||||
id = QString::number(song.album_id());
|
id = song.album_id();
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Songs:
|
case FavoriteType_Songs:
|
||||||
if (song.song_id() <= 0) continue;
|
if (song.song_id() <= 0) continue;
|
||||||
@@ -201,18 +201,18 @@ void TidalFavoriteRequest::RemoveFavorites(const FavoriteType type, const SongLi
|
|||||||
|
|
||||||
if (songs.isEmpty()) return;
|
if (songs.isEmpty()) return;
|
||||||
|
|
||||||
QList<int> ids;
|
QList<qint64> ids;
|
||||||
QMultiMap<int, Song> songs_map;
|
QMultiMap<qint64, Song> songs_map;
|
||||||
for (const Song &song : songs) {
|
for (const Song &song : songs) {
|
||||||
int id = -1;
|
qint64 id = -1;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FavoriteType_Artists:
|
case FavoriteType_Artists:
|
||||||
if (song.artist_id() <= 0) continue;
|
if (song.artist_id() <= 0) continue;
|
||||||
id = song.artist_id();
|
id = song.artist_id();
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Albums:
|
case FavoriteType_Albums:
|
||||||
if (song.album_id() <= 0) continue;
|
if (song.album_id().isEmpty()) continue;
|
||||||
id = song.album_id();
|
id = song.album_id().toLongLong();
|
||||||
break;
|
break;
|
||||||
case FavoriteType_Songs:
|
case FavoriteType_Songs:
|
||||||
if (song.song_id() <= 0) continue;
|
if (song.song_id() <= 0) continue;
|
||||||
|
|||||||
@@ -1033,13 +1033,13 @@ void TidalRequest::FlushAlbumCoverRequests() {
|
|||||||
QNetworkRequest req(request.url);
|
QNetworkRequest req(request.url);
|
||||||
QNetworkReply *reply = network_->get(req);
|
QNetworkReply *reply = network_->get(req);
|
||||||
album_cover_replies_ << reply;
|
album_cover_replies_ << reply;
|
||||||
NewClosure(reply, SIGNAL(finished()), this, SLOT(AlbumCoverReceived(QNetworkReply*, const qint64, const QUrl&)), reply, request.album_id, request.url);
|
NewClosure(reply, SIGNAL(finished()), this, SLOT(AlbumCoverReceived(QNetworkReply*, const QString&, const QUrl&)), reply, request.album_id, request.url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const qint64 album_id, const QUrl &url) {
|
void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url) {
|
||||||
|
|
||||||
if (album_cover_replies_.contains(reply)) {
|
if (album_cover_replies_.contains(reply)) {
|
||||||
album_cover_replies_.removeAll(reply);
|
album_cover_replies_.removeAll(reply);
|
||||||
@@ -1083,7 +1083,7 @@ void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const qint64 album_i
|
|||||||
|
|
||||||
QDir dir;
|
QDir dir;
|
||||||
if (dir.mkpath(service_->CoverCacheDir())) {
|
if (dir.mkpath(service_->CoverCacheDir())) {
|
||||||
QString filename(service_->CoverCacheDir() + "/" + QString::number(album_id) + "-" + url.fileName());
|
QString filename(service_->CoverCacheDir() + "/" + album_id + "-" + url.fileName());
|
||||||
if (image.save(filename, "JPG")) {
|
if (image.save(filename, "JPG")) {
|
||||||
while (album_covers_requests_sent_.contains(album_id)) {
|
while (album_covers_requests_sent_.contains(album_id)) {
|
||||||
Song *song = album_covers_requests_sent_.take(album_id);
|
Song *song = album_covers_requests_sent_.take(album_id);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class TidalRequest : public TidalBaseRequest {
|
|||||||
|
|
||||||
void ArtistAlbumsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const int offset_requested);
|
void ArtistAlbumsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const int offset_requested);
|
||||||
void AlbumSongsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const qint64 album_id, const int offset_requested, const QString &album_artist);
|
void AlbumSongsReplyReceived(QNetworkReply *reply, const qint64 artist_id, const qint64 album_id, const int offset_requested, const QString &album_artist);
|
||||||
void AlbumCoverReceived(QNetworkReply *reply, const qint64 album_id, const QUrl &url);
|
void AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef QPair<QString, QString> Param;
|
typedef QPair<QString, QString> Param;
|
||||||
@@ -101,7 +101,7 @@ class TidalRequest : public TidalBaseRequest {
|
|||||||
};
|
};
|
||||||
struct AlbumCoverRequest {
|
struct AlbumCoverRequest {
|
||||||
qint64 artist_id = 0;
|
qint64 artist_id = 0;
|
||||||
qint64 album_id = 0;
|
QString album_id = 0;
|
||||||
QUrl url;
|
QUrl url;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ class TidalRequest : public TidalBaseRequest {
|
|||||||
|
|
||||||
QList<int> artist_albums_requests_pending_;
|
QList<int> artist_albums_requests_pending_;
|
||||||
QHash<int, Request> album_songs_requests_pending_;
|
QHash<int, Request> album_songs_requests_pending_;
|
||||||
QMultiMap<int, Song*> album_covers_requests_sent_;
|
QMultiMap<QString, Song*> album_covers_requests_sent_;
|
||||||
|
|
||||||
int artists_requests_active_;
|
int artists_requests_active_;
|
||||||
int artists_total_;
|
int artists_total_;
|
||||||
|
|||||||
@@ -204,8 +204,6 @@ void TidalService::ReloadSettings() {
|
|||||||
if (client_id_.isEmpty()) client_id_ = QString::fromUtf8(QByteArray::fromBase64(kClientIdB64));
|
if (client_id_.isEmpty()) client_id_ = QString::fromUtf8(QByteArray::fromBase64(kClientIdB64));
|
||||||
api_token_ = s.value("api_token").toString();
|
api_token_ = s.value("api_token").toString();
|
||||||
if (api_token_.isEmpty()) api_token_ = QString::fromUtf8(QByteArray::fromBase64(kApiTokenB64));
|
if (api_token_.isEmpty()) api_token_ = QString::fromUtf8(QByteArray::fromBase64(kApiTokenB64));
|
||||||
user_id_ = s.value("user_id", 0).toInt();
|
|
||||||
country_code_ = s.value("country_code", "US").toString();
|
|
||||||
|
|
||||||
username_ = s.value("username").toString();
|
username_ = s.value("username").toString();
|
||||||
QByteArray password = s.value("password").toByteArray();
|
QByteArray password = s.value("password").toByteArray();
|
||||||
@@ -222,6 +220,8 @@ void TidalService::ReloadSettings() {
|
|||||||
cache_album_covers_ = s.value("cachealbumcovers", true).toBool();
|
cache_album_covers_ = s.value("cachealbumcovers", true).toBool();
|
||||||
stream_url_method_ = static_cast<TidalSettingsPage::StreamUrlMethod>(s.value("streamurl").toInt());
|
stream_url_method_ = static_cast<TidalSettingsPage::StreamUrlMethod>(s.value("streamurl").toInt());
|
||||||
|
|
||||||
|
user_id_ = s.value("user_id").toInt();
|
||||||
|
country_code_ = s.value("country_code", "US").toString();
|
||||||
access_token_ = s.value("access_token").toString();
|
access_token_ = s.value("access_token").toString();
|
||||||
refresh_token_ = s.value("refresh_token").toString();
|
refresh_token_ = s.value("refresh_token").toString();
|
||||||
session_id_ = s.value("session_id").toString();
|
session_id_ = s.value("session_id").toString();
|
||||||
@@ -559,12 +559,12 @@ void TidalService::HandleAuthReply(QNetworkReply *reply) {
|
|||||||
|
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(TidalSettingsPage::kSettingsGroup);
|
s.beginGroup(TidalSettingsPage::kSettingsGroup);
|
||||||
s.setValue("user_id", user_id_);
|
|
||||||
s.setValue("session_id", session_id_);
|
|
||||||
s.setValue("country_code", country_code_);
|
|
||||||
s.remove("access_token");
|
s.remove("access_token");
|
||||||
s.remove("refresh_token");
|
s.remove("refresh_token");
|
||||||
s.remove("expiry_time");
|
s.remove("expiry_time");
|
||||||
|
s.setValue("user_id", user_id_);
|
||||||
|
s.setValue("session_id", session_id_);
|
||||||
|
s.setValue("country_code", country_code_);
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
qLog(Debug) << "Tidal: Login successful" << "user id" << user_id_ << "session id" << session_id_ << "country code" << country_code_;
|
qLog(Debug) << "Tidal: Login successful" << "user id" << user_id_ << "session id" << session_id_ << "country code" << country_code_;
|
||||||
@@ -585,6 +585,8 @@ void TidalService::Logout() {
|
|||||||
|
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(TidalSettingsPage::kSettingsGroup);
|
s.beginGroup(TidalSettingsPage::kSettingsGroup);
|
||||||
|
s.remove("user_id");
|
||||||
|
s.remove("country_code");
|
||||||
s.remove("access_token");
|
s.remove("access_token");
|
||||||
s.remove("session_id");
|
s.remove("session_id");
|
||||||
s.remove("expiry_time");
|
s.remove("expiry_time");
|
||||||
|
|||||||
Reference in New Issue
Block a user