Commit Graph

30 Commits

Author SHA1 Message Date
ejurgensen 9f719ca155 [player/jsonapi/db] Add interface to get and set an output format 2024-06-17 22:25:20 +02:00
X-Ryl669 cf8b3ecd3a [db,library] Add support for parsing lyrics and storing them in DB 2023-10-19 23:49:53 +02:00
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 4dcc9b602e [db] add review 'flag' column to files/queue tbls 2021-09-06 20:15:35 +01:00
ejurgensen 5f1686695a [-] Name update forked-daapd -> owntone throughout the code 2021-04-24 23:54:20 +02:00
ejurgensen bd91a238ec [db] Upgrade schema to 21.06, change default of query_limit to 0 2021-02-10 20:04:56 +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 00de0a3f76 [db] Fixup commit #1edfadc 2020-02-23 20:25:22 +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 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 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 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 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 fde0a28142 Support for skip_count and time_skipped file metadata 2018-08-18 22:56:27 +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 0e9bca9e3d [db] Add column for auth key to speakers table (incl methods for saving/retrieving) 2017-06-18 01:29:40 +02: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 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 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
chme f7aa3c225b [db] Move initialization of new db into its own file (db_init.c) 2016-11-04 14:31:15 +01:00