Commit Graph

240 Commits

Author SHA1 Message Date
ejurgensen
da376cbeb9 Upgrade database schema to v15.0 -> 15.1 2015-01-14 20:37:29 +01:00
ejurgensen
d16cf2fe7c Introduce major and minor schema versioning to improve vers compability
- also make database vacuuming on startup optional
2015-01-14 20:32:36 +01:00
ejurgensen
829619be5d Vacuum on startup and also make index changes possible without schema updates 2015-01-10 22:44:26 +01:00
ejurgensen
1f81b5ce7e Revert "Upgrade db schema to v16"
This reverts commit bfa9f4d5cf.
2015-01-10 20:31:13 +01:00
ejurgensen
b605dc2fc3 Spelling mistake 2015-01-10 19:19:45 +01:00
ejurgensen
a96af67a30 Some fixing up of prev commit 2015-01-10 00:45:19 +01:00
ejurgensen
bfa9f4d5cf Upgrade db schema to v16 2015-01-10 00:08:50 +01:00
ejurgensen
2208c021aa Improve browse queries (credit @chme)
Adjusted re-commit of commit ec47c6e730
2015-01-09 23:59:38 +01:00
ejurgensen
27a2fabb56 Modify groups queries and improve index 2015-01-09 23:04:50 +01:00
ejurgensen
ea598bfeaf Remove upgrade paths for indices (since they don't have any data anyway), and instead implement db_create_indices and db_drop_indices to reduce redundancy 2015-01-09 00:28:06 +01:00
ejurgensen
ad48ccb804 Revert "Merge branch 'db' of git://github.com/chme/forked-daapd into chme-db"
This reverts commit b8d5e32160, reversing
changes made to 5a02f926e3.
2015-01-08 22:40:47 +01:00
chme
ec47c6e730 optimize queries and indexes for composer/genre 2014-12-29 09:24:29 +01:00
chme
5cb06980e3 Optimize the indexes on the files table to speed up select queries 2014-12-29 09:24:29 +01:00
chme
e321e5137f db update v16 and cache update v2 2014-12-29 09:24:28 +01:00
chme
31870fe046 improve selects for files table by removing the join to the groups table 2014-12-29 09:24:28 +01:00
ejurgensen
3e412b5e65 Remove misplaced quotes in db_group_type_bypersistentid() 2014-12-28 23:32:21 +01:00
chme
3208315503 fix delete query for removing files if a spotify playlist is deleted 2014-12-27 21:44:25 +01:00
chme
7578bb1205 Artwork caching (pull request #61), and also:
- introduced new section in config file for sqlite pragma settings,
added config for artwork cache
- added setting of pragma synchronous, cache size and journal mode to
daap cache
2014-11-10 22:53:08 +01:00
ejurgensen
2545aedc2a Avoid duplicate rows in the admin table 2014-08-27 22:12:42 +02:00
ejurgensen
624dd40c59 Include DAAP queries from Retune and TunesRemote+ for caching
+ misc fixing up
2014-08-22 22:51:13 +02:00
ejurgensen
f997aca452 More DAAP cache adjustments 2014-08-21 23:06:52 +02:00
ejurgensen
eac718ea0f Some more daap cache triggers 2014-08-21 10:14:24 +02:00
ejurgensen
f3a19fce8e Add DAAP cache backend 2014-08-20 00:21:48 +02:00
ejurgensen
a594455e09 Add db_query_run() to get rid of some redundancy in db.c 2014-08-18 00:20:23 +02:00
ejurgensen
d5efc2dcb3 Add db interface to update the admin table 2014-08-15 22:54:47 +02:00
chme
974c6e6323 add missing "#undef Q_TMPL" 2014-07-27 11:16:00 +02:00
chme
46c0239a79 Added options to modify the operation of the SQLite database (through PRAGMA statements)
- set cache size (in number of pages)
- set synchronous flag
- set journal mode
2014-07-13 10:35:38 +02:00
ejurgensen
1bd11d2895 Fix so permission changes in the library are handled (issue #8) 2014-06-09 23:42:02 +02:00
ejurgensen
b566c41a36 Setting log level to info gave a lot of meaningless db.c messages 2014-06-01 23:58:44 +02:00
ejurgensen
915719f0f8 Fix Spotify exemption from purge during init-rescan 2014-05-14 20:44:07 +02:00
ejurgensen
c1be585469 Extra log message for debugging apparent db locking issue 2014-05-13 22:02:32 +02:00
ejurgensen
a5b2fbc0fe Wrap bulk scan in a db transaction (credit @chme) 2014-05-11 23:13:09 +02:00
ejurgensen
a2f90a997c Make sure albums/artists appear the same despite different capitalization 2014-04-30 23:30:08 +02:00
ejurgensen
2c16b070ed Make the update of playcount non-blocking for playback
- otherwise slow updates would disrupt streaming when switching track
2014-04-18 22:31:37 +02:00
ejurgensen
35e9b3dc30 Fix bug in m3u scanner 2014-04-18 13:08:31 +02:00
ejurgensen
7c3da47eb7 Small DAAP changes to align with iTunes 2014-03-23 00:23:34 +01:00
ejurgensen
7ed6cc98c3 Add support for Spotify (squashed commit), and:
- Try to not return items which a client can't play
    - Remove inotify subscription to IN_MODIFY and IN_CREATE
    - Fix crash on unknown codec type in transcode.c
    - Probably added some new bugs...
2014-03-11 23:20:29 +01:00
ejurgensen
190f91114e Support songartistid (asri) in group requests and queuefilter=artist
- credit misenhower of wp8remote.com
2014-02-21 20:39:57 +01:00
ejurgensen
dd4ebfc42e Make sure there are no remnants from last upgrade before upgrading the db 2014-01-15 18:29:57 +01:00
ejurgensen
eac404fa3a Add artwork field to db (upgrade to v15). Set field when embedded
artwork found by the filescanner. Reenable support for embedded
artwork in group requests.
2014-01-11 23:05:29 +01:00
ejurgensen
371ed3070c Add seek to standard db queries 2013-12-19 20:26:38 +01:00
ejurgensen
ab86e30be4 Fix bug where sort fields were not implemented in group replies 2013-12-18 19:14:39 +01:00
ejurgensen
fe16a9ca4e Merge branch 'audiobooks' into db_upgrade_14 2013-12-17 21:03:26 +01:00
ejurgensen
dbb043198d Upgrade database to version 14 (artist groups and seek)
- add songartistid to support artist groups
- add corresponding trigger
- add seek field for later use (to save playback position)
- add G_ARTISTS and adjust queries
- add smart playlists Podcasts/Audiobooks with db upgrade
2013-12-17 20:58:55 +01:00
ejurgensen
ec2637285d In group?group-type=artists type queries return better persistent id
- this is a temporary solution until real persistent id's can be
used. This change uses a hash of album_artist instead of returning
a fixed value of 1. Thank you SquallyDoc, author of Retune, for
helping out with this and suggesting this solution.
2013-12-16 22:29:47 +01:00
ejurgensen
a925268d50 Include groups table in database purge 2013-12-16 22:21:04 +01:00
ejurgensen
b5247aab1d Don't cast to char with malloc and some error handling 2013-12-15 22:15:45 +01:00
ejurgensen
b3ea04a047 Some cleaning up in group handling in db.c in prep for artist groups 2013-12-15 21:47:49 +01:00
ejurgensen
a35f6c4376 Basic audiobook support 2013-12-08 23:03:03 +01:00
ejurgensen
2765a12f76 Forgot composer-sort and two instances of strip_article() 2013-12-05 22:46:12 +01:00
ejurgensen
a102d3f138 Set sort headers from sort fields in db 2013-12-05 21:56:02 +01:00
ejurgensen
a30069c0c7 Honor sorting in more daap replies and some minor restructuring of http_daapd.c 2013-12-03 23:16:07 +01:00
ejurgensen
8882374a75 Disable instead of purging when root library dir is not present 2013-11-30 23:12:09 +01:00
ejurgensen
414817031d Configurable library names
Names of Library, Music, Movies, TV Shows and Podcasts made configurable
2013-11-30 12:57:38 +01:00
ejurgensen
adc9c03763 Allow user to trigger full rescan with a .force-rescan file 2013-11-29 22:48:53 +01:00
ejurgensen
6eaf47a8d6 Show items with genre=Podcast as Podcast items in Remote
- also add Podcast smart playlist to default playlists
2013-10-18 23:07:40 +02:00
ejurgensen
95fc525beb Add support for artist group request (experimental)
The purpose of this is mainly to support Hyperfine Remote for Android
2013-08-29 22:00:37 +02:00
ejurgensen
fe79922c6e Forgot return value 2013-08-21 23:30:30 +02:00
ejurgensen
9d0962407a The m3u playlist scanner improvements in commit 6e9cf3a resulted in
too many database lookups. This is a more efficient version.
2013-08-21 23:16:25 +02:00
ejurgensen
6e9cf3a243 This makes the scanner more flexible when matching paths in playlists
with the library paths.
2013-08-20 21:58:35 +02:00
ejurgensen
86cf922615 Prefer album artist even when DAAP says artist 2013-07-22 22:30:55 +02:00
Thijs Reus
6c7fa8f299 Now artists/albums are properly sorted and grouped 2013-05-24 18:51:57 +02:00
Julien BLACHE
ad4e15c362 Handle database upgrade v12 -> v13 2011-09-10 12:56:30 +02:00
Julien BLACHE
efcd463946 Add indexes for playlists 2011-09-10 12:56:30 +02:00
Julien BLACHE
664067fd88 Rewrite group queries, remove JOIN, add index
SQLite has trouble optimizing the query when written with JOIN, but does
pretty well using the indexes when written without JOIN. Add an index for
the query, too.
2011-09-10 12:56:30 +02:00
Julien BLACHE
cbc7108fcf Use table aliases in all queries, update RSP & DAAP filters to match 2011-09-10 12:56:30 +02:00
Julien BLACHE
617c026060 Add covering indexes for *{,_sort} fields
These indexes help queries searching on these fields and will act as covering
indexes for sort strings, too.
2011-09-10 12:56:30 +02:00
Julien BLACHE
becdfdb062 Add new indexes for general speedup
An index on songalbumid helps for joins on songalbumid on the files table; a
covering index on disabled+media_kind+songalbumid helps in numerous queries
all over the place.
2011-09-10 12:56:30 +02:00
Julien BLACHE
1dfd27090e Speedup startup rescan 2011-09-10 12:56:30 +02:00
Julien BLACHE
96c367f556 Kill useless database indexes 2011-09-10 12:56:30 +02:00
Julien BLACHE
333b7710bc Queries must hit SQLITE_DONE to execute profiling callback 2011-09-10 12:56:30 +02:00
Julien BLACHE
d05634fddd Print query execution time in milliseconds 2011-09-10 12:56:29 +02:00
Julien BLACHE
a2b7b811b8 Add query plan to DB profiling callback 2011-09-10 12:56:29 +02:00
Julien BLACHE
1909623d43 Run ANALYZE after DB startup 2011-09-10 12:56:29 +02:00
Peter Carmichael
3caae459be Add DB maintenance routines 2011-09-10 12:56:29 +02:00
Julien BLACHE
759cc55b0f Fix bad parameters in I_LAST index clause 2011-06-05 11:04:57 +02:00
Julien BLACHE
4f3635e354 Handle SQLITE_SCHEMA error in db_exec()
This happens under database load with many concurrent threads doing updates;
queries failing with SQLITE_SCHEMA at step time need to retried from scratch
until they succeeded or hit a best-effort limit of 5 retries.
2011-05-28 10:48:31 +02:00
Julien BLACHE
4594cc3d63 Enhance db_exec() error messages 2011-05-28 10:46:41 +02:00
Julien BLACHE
54c5314712 Handle empty files table when upgrading from schema v11 -> v12 2011-04-06 18:38:53 +02:00
Julien BLACHE
e5b4c1146e Handle database upgrade v11 -> v12 2011-03-24 19:23:08 +01:00
Julien BLACHE
9759eeba71 Remove database upgrade for schema version before 10 (v0.12) 2011-03-21 18:48:00 +01:00
Kai Elwert
cb9dc5ad7c Add COLLATE DAAP to all char-type fields
As a consequence, we can remove the explicit COLLATE DAAP from sort
clauses, index definitions and queries.
2011-03-21 18:48:00 +01:00
Kai Elwert
e226c38d4f Add db_query_fetch_string_sort() to fetch string+sortstring results 2011-03-21 18:48:00 +01:00
Kai Elwert
d8bf5eedce db_build_query_browse() query changes ("DISTINCT %s, %s", field, field) 2011-03-21 18:48:00 +01:00
Kai Elwert
9e5015ffc8 Switch sort clauses to *_sort fields 2011-03-21 18:47:59 +01:00
Kai Elwert
373c5584af Add sort tags to the database 2011-03-21 18:47:59 +01:00
Julien BLACHE
eeb5a7974d Trim metadata strings on files INSERT/UPDATE 2011-03-08 18:55:51 +01:00
Julien BLACHE
69396f3da0 Kill bogus comments 2011-03-07 19:51:43 +01:00
Julien BLACHE
6f7b12b1f2 Handle database upgrade v10 -> v11 2010-12-04 15:08:06 +01:00
Julien BLACHE
27c89cf312 Remove old db_config_* interface 2010-12-04 15:08:06 +01:00
Julien BLACHE
012e90b4a3 Add a dedicated table for speakers 2010-12-04 15:08:06 +01:00
Kai Elwert
e5af78fe9f Implement sort=artist for DAAP queries 2010-10-09 16:06:00 +02:00
Kai Elwert
cd8686be82 Add DB profiling support 2010-09-29 18:56:38 +02:00
Julien BLACHE
5c81144beb Revert to standard SQLite functions for DB startup, creation and upgrade
No need to use the blocking variants here as there is no concurrency during
DB startup.
2010-09-29 18:26:31 +02:00
Julien BLACHE
b79cf13c95 Remove custom collation and custom daap_songalbumid() function code 2010-09-28 18:39:43 +02:00
Julien BLACHE
da0011de3b Load our SQLite extension 2010-09-28 18:38:10 +02:00
Julien BLACHE
c6c53e6a28 Fix integer type mismatch in SQL query
sample_count is uint64, not int.
2010-09-10 20:58:10 +02:00
Julien BLACHE
e90e81cdf5 Remove no-op "OR REPLACE" 2010-09-04 11:38:15 +02:00
John Thomson
f50e17b60f Take disc number into account for track ordering inside albums 2010-09-04 11:33:30 +02:00
Kai Elwert
9dec6d23be Use DAAP collation in sort clauses 2010-08-29 12:07:07 +02:00