Commit Graph

49 Commits

Author SHA1 Message Date
chme
1d2e4dc7a8 [db,library] Add "scan_kind" field to playlists, directories and files
(db upgrade to v22.00)

`scan_kind` identifies the library "scanner" component that created the
item and is responsible to keep it up to date (rescan).

The library update now supports passing a `scan_kind` to update only the
items of one particular "scanner". This allows e. g. to only update the
item from the Spotify library or only update the RSS feeds.

The OwnTone database is upgraded to v22.00 and the `scan_kind` columns
in `files`, `playlists`, `directories` are identified by:

 1. Check if item is part of a RSS playlist (podcast RSS feed), they
belong to the "rssscanner"
 2. Check if item has a Spotify `virtual_path`, they belong to the
"spotifyscanner"
 3. Remaining items belong to the "filescanner"
2022-01-22 10:38:31 +01:00
whatdoineed2do/Ray
4d5c256327 [db,jsonapi] revert usermark from queue item table 2021-09-16 10:43:55 +01:00
whatdoineed2do/Ray
d43ce017f5 [db,jsonapi,smartpl] db usermark flag review 2021-09-08 14:51:55 +01:00
whatdoineed2do/Ray
4dcc9b602e [db] add review 'flag' column to files/queue tbls 2021-09-06 20:15:35 +01:00
ejurgensen
13be7999cb [db] Add some headers in db_upgrade.c for easier navigation 2021-02-10 20:05:56 +01:00
ejurgensen
bd91a238ec [db] Upgrade schema to 21.06, change default of query_limit to 0 2021-02-10 20:04:56 +01:00
chme
f75947f29a [db] Remove break after v2103 update and directly run update for v2104
The break results in the ugrade stopping at v2103 and only after another
restart of forked-daapd the update to v2104 happens. Removing it will
directly update to the latest DB version.
2021-01-23 16:32:41 +01:00
chme
9ff06f094d [htdocs] Rebuild web interface v0.8.5 2021-01-16 08:23:50 +01:00
ejurgensen
9cdd2a9f8b [db] Upgrade schema to 21.05 (change auth_keys in speaker table) 2021-01-10 15:05:21 +01:00
whatdoineed2do/Ray
9a0c7e9ad2 [db] v21.4 - add playlist..artwork_url column 2020-04-30 20:28:36 +02:00
ejurgensen
248f82f3c8 [db] Fixup fixup in commit #00de0a3 (upgrade dbvers to 21.3)
Forgot to include db_upgrade to v21.3
2020-02-23 21:26:00 +01:00
ejurgensen
40c7522baa [db] Make Apple Music on Catalina work - part 2 (fix for issue #834)
Extends the playlist table with media_kind to handle playlist queries like
this from Apple Music:

/databases/71/containers?session-id=12345678&revision-number=4&delta=0&query=('dmap.itemname:Library%20name','com.apple.itunes.extended-media-kind:1','com.apple.itunes.extended-media-kind:32','com.apple.itunes.extended-media-kind:128','com.apple.itunes.extended-media-kind:65537')&meta=dmap.itemid,dmap.itemname,dmap.persistentid,dmap.parentcontainerid,com.apple.itunes.is-podcast-playlist,com.apple.itunes.special-playlist,com.apple.itunes.smart-playlist,dmap.haschildcontainers,com.apple.itunes.saved-genius,dmap.objectextradata
2019-11-01 15:44:53 -07:00
whatdoineed2do/Ray
b126a2fbc0 [db] add 'channels' to file/queue tbl 2019-06-12 16:52:02 +01:00
whatdoineed2do/Ray
c796db251d [db] schema v20.01 support codec type/bitrate/samplerate in queue tbl 2019-06-12 16:50:52 +01:00
ejurgensen
b3d6211371 [db] Upgrade db schema to 21.0
Commit b3bfb0a and e1993bc change the triggers and calculation of id's in a way
that is not backwards compatible, so we need to make major schema upgrade.
2019-05-17 23:07:48 +02:00
ejurgensen
e1993bc7b6 [db] Comeback for the files-table insert trigger 2019-05-17 23:03:05 +02:00
ejurgensen
b3bfb0a5f6 [db] Move calculation of artist/album id's from sqlite to code
The purpose of this is to support library backends making their own
calculation of these id's, which is relevant if they have more information
available than just album_artist and album.

This also removes a bunch of sqlite extension code plus some triggers, which
in itself is probably an improvement.
2019-05-17 23:03:05 +02:00
whatdoineed2do/Ray
7e02eb510d [db] add songartistid to queue tbl 2019-02-12 09:21:39 +00:00
ejurgensen
cd7af46c36 [db] Generic version of db_drop_indices/triggers + fix memleak
Memleak in db_drop_triggers() in error case (array "index" not being freed)
2019-01-01 21:34:29 +01:00
ejurgensen
8043ca1291 [db] Drop upgrade support for pre-v17 db versions
Also drop the old way of recreating the files table, it is now replaced by
db_table_upgrade().
2018-12-31 15:55:49 +01:00
ejurgensen
a4c254e6e7 [db] Recreate v20 files table, so that new constraints take effect if upgrading
The constraints on songalbumid and songartistid where changed with v20, so we
need to make sure they take effect when upgrading.

This commit tries to do the table recreation like sqlite recommends and without
manually crafted copy queries that are probably prone to errors.

Since we are recreating anyway, this commit also reorders the columns slightly.

It also includes auto-drop/recreation of triggers (should really have been its
own commit) during upgrade, like is already done with indices.
2018-12-31 15:55:49 +01:00
ejurgensen
d3121f4ec7 [db] Use prepared statements for file insert, update and ping
Get rid of the SQL query strings, since they are prone to errors and are
probably also slower that using prepared statements.
2018-12-31 15:55:49 +01:00
chme
b7f3e71f7e [db_upgrade] Fix memory leak in error case
db_upgrade.c:72:7: warning: Potential memory leak
2018-12-29 16:34:56 +01:00
chme
42cbd721fd [db] Minor version upgrade: new column "path" in directories table 2018-12-18 08:28:19 +01:00
whatdoineed2do
488f52b04f [db] schema v19.11 support composer in queue tbl 2018-11-30 17:22:21 +01:00
ejurgensen
f686756dd8 [db] Upgrade schema to 19.10 to remove invalid time_skipped values from commit fde0a281 2018-09-19 19:40:45 +02:00
ejurgensen
16e375e637 [db/misc] Cast ARRAY_SIZE to unsigned (avoids compiler warnings) 2018-09-04 20:07:05 +02:00
ejurgensen
fde0a28142 Support for skip_count and time_skipped file metadata 2018-08-18 22:56:27 +02:00
chme
6ceede44f4 [db] Use default -1 for playlists.query_limit column 2018-04-15 22:11:40 +02:00
chme
f167e975c2 Unify naming of "order by" clause in structs/table 2018-04-15 22:11:40 +02:00
chme
6bdcda1524 [db/filescanner] Upgrade database to v19.08 and support limit/order by
in smart playlist files
2018-04-15 22:11:40 +02:00
ejurgensen
ea6fd1476a [db] Improve speed of browse queries (issue #478)
Before, we returned either unordered (for RSP, meaning client had to
sort) or ordered by a client selected sort_clause[]. The latter are
multi-purpose and therefore not optimised for browse queries.

To speed up, we predefine the entire set of browse queries, including
order, with matching indices. The predefined queries are used except
if the client explicitly requests a non-default order or query.

As a special bonus, the commit also allows queries with I_SUB that
have an offset but no limit.
2018-03-02 21:11:31 +01:00
chme
91573752d9 [db] Update v19.05 to v19.06
- queue table: define id column as AUTOINCREMENT (requires drop+create)
- queue table: add column queue_version
- files table: update http-stream virtual paths (constructing the
virtual path for http-streams changed in pr #449, this migrates existing
databases to be consistent to the newly created paths)
2017-12-09 11:01:41 +01:00
ejurgensen
4d47307a02 [db/filescanner] Add index on fname, change playlist matching (wip) 2017-10-17 23:11:31 +02:00
ejurgensen
f63d103753 [raop] Add support for Apple TV device verification, required by tvOS 10.2 (fix for issue #377)
- also change how speakers are saved/retrieved from the db
- add generic authorization methods in outputs.c and player.c
- let filescanner read *.verification files (containing PIN)
- configure options to enable and disable, since libsodium is required
2017-06-19 21:52:01 +02:00
ejurgensen
0e9bca9e3d [db] Add column for auth key to speakers table (incl methods for saving/retrieving) 2017-06-18 01:29:40 +02:00
chme
82e216c931 Add missing FALLTHROUGH comments to switch-case statements
This allows to suppress code analysis warnings in IDEs for missing break
statements.
2017-02-26 11:04:04 +01:00
ejurgensen
e92152cadb [db] Upgrade db to 19.03: Add artwork_url column to queue table 2017-01-27 22:36:00 +01:00
chme
e29539fa68 [db] add primary key to admin table 2016-12-10 06:15:43 +01:00
chme
94f450769d [db] Fix upgrade to v19.01 2016-12-09 07:08:14 +01:00
chme
d431ace5c4 [db] Use a minor version update for the new queue table (v19.01 instead
of v20.00)
2016-12-04 07:28:06 +01:00
chme
b5bf1928ff [db] Rename "plversion" to "queue_version", add missing init query for
queue_version
2016-12-03 11:12:19 +01:00
chme
0beb68e1f1 [db] Upgrade db to v20.00
- New table 'queue' for persisting the queue/current playlist
- New entry 'plversion' in admin table for queue version
2016-12-03 10:58:26 +01:00
ejurgensen
bdd6bab982 [-] Lots of housekeeping thanks to scan-build and input from @acmay 2016-11-19 23:08:50 +01:00
chme
491bf54fdb [directories/spotify] Init db with disabled spotify-root-directory and
enable only on successful login to spotify
2016-01-31 08:14:03 +01:00
chme
8600c21424 [db-upgrade] add column date_released to files table, add column name to
speakers table
2016-01-31 08:14:03 +01:00
chme
1a6565e512 [directories] Initialize root directories on db init 2016-01-24 18:51:22 +01:00
chme
7703a997c4 [db/filescanner/spotify] Replace filelist-view with separate
directories-table
to increase the performance of the mpd command 'lsinfo'
2016-01-24 18:51:22 +01:00
chme
3740486348 [db] Move database upgrade logic to separate file 2016-01-24 18:51:22 +01:00