1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

Add database migrations to fix up the bitrate units

The migration assumes that no audio files will be <16kbps and only wav
files will be more than 16,000kbps.
This commit is contained in:
Carey Metcalfe 2023-03-31 20:40:28 -04:00
parent 109f81e713
commit 639c68291a
4 changed files with 19 additions and 1 deletions

View File

@ -31,7 +31,7 @@ from playhouse.db_url import parseresult_to_dict, schemes
from urllib.parse import urlparse
from uuid import UUID, uuid4
SCHEMA_VERSION = "20230115"
SCHEMA_VERSION = "20230331"
def now():

View File

@ -0,0 +1,5 @@
START TRANSACTION;
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
COMMIT;

View File

@ -0,0 +1,5 @@
START TRANSACTION;
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
COMMIT;

View File

@ -0,0 +1,8 @@
COMMIT;
PRAGMA foreign_keys = OFF;
BEGIN TRANSACTION;
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
COMMIT;
BEGIN TRANSACTION;