ejurgensen
50c6d3f272
[db] Silence misleading log error message
...
We were logging a missing lastfm_sk in the admin table as
an error, which it really isn't
2018-03-03 20:13:09 +01: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
cd96ec579a
[db/library] Use "PRAGMA optimize" instead of "ANALYZE"
...
ANALYZE collects and saves statistics even if there were no database
changes and the last collected data is still good.
According to the sqlite3 documentation, it is recommended to use "PRAGMA
optimize" which will call "ANALYZE" if it is necessary. "PRAGMA
optimize" will run "ANALYZE" based on prior queries on the same database
connection. It is recommended to run optimize before closing the
connection.
(see https://www.sqlite.org/lang_analyze.html )
2018-02-26 18:41:28 +01:00
chme
30aa4cf525
[db] Fix comments
2018-02-22 21:36:14 +01:00
chme
8b2d40d46f
Initialize local variables to silence OpenWrt compiler warnings
2018-02-22 21:35:38 +01:00
ejurgensen
c23f2c01b2
[scan] Fix bugs related to iTunes XML playlists
...
1) They would get disabled after rescan
2) Playlists and playlistitems didn't get cleaned up
2018-01-25 22:26:00 +01:00
chme
18a6372fb1
[dbperf] Use sqlite3_trace_v2 instead of deprecated sqlite3_profile
...
Set log severity depending on how long the query was running and return
early if log level is lower than the current one.
2018-01-13 11:05:58 +01:00
chme
981fd3e183
[db] Update queue_version in db_queue_move_byitemid
...
Fixes missing queue updates in MPDroid after moving an item in the
queue. MPDroid moves items with the 'moveid' command and retrieves the
playlist changes with the 'plchanges' command, due to the missing
queue_version update the last command did not return any changes and the
queue in MPDroid did not get updated.
2017-12-30 08:01:07 +01:00
chme
56f4b32ef3
Add option to enable memory-mapped I/O
2017-12-26 08:06:38 +01:00
ejurgensen
731106276f
Merge pull request #466 from chme/libspotify_remove_scan
...
[spotify] Remove scanning saved playlist with libspotify
2017-12-25 19:33:41 +01:00
chme
a1372c692e
[mpd] Implement 'playlistfind' and 'playlistsearch'
2017-12-22 11:24:43 +01:00
chme
471eb9db46
[db] Do not trigger a DATABASE event if db_directory_enable_bypath does
...
not change the library
2017-12-17 09:13:09 +01:00
ejurgensen
b428760599
[scan] Fix for issue #463 , fname not getting updated on file rename
...
Also modify code style of _enable/_disable functions in db.c
2017-12-16 23:09:29 +01:00
chme
5a57a564a4
[db] Instantly notify about rating changes
2017-12-15 19:08:32 +01:00
chme
e7d6fbb9fc
[listener/etc.] Rename LISTENER_STICKER to LISTENER_RATING
...
Unit there is a real sticker implementation, make it clear, that the
event is only triggered for rating changes.
2017-12-15 19:08:32 +01:00
chme
ef52f4ddc0
Rework user rating updates
2017-12-15 19:08:32 +01:00
chme
88f7d4601d
[db] Fix adding urls to the queue that are not in the library
2017-12-13 22:02:38 +01:00
chme
912635e737
[db] Update queue_version for changed queue items
2017-12-09 11:01:41 +01:00
Wolfgang Scherer
bb451802d2
[db] Queue notification when metadata changes ( #448 )
2017-12-02 16:44:29 +01:00
chme
4800f9943b
[db] Rename 'ADMIN_*' defines to 'DB_ADMIN_*'
2017-11-19 22:08:23 +01:00
chme
f49a3c888a
[db] Store start time in admin table
2017-11-19 22:08:23 +01:00
chme
38ab4b9676
[db] Functions to read/store int in the admin table and introduce
...
constants for admin table keys
2017-11-19 22:08:23 +01:00
chme
4fe4bee809
[db] Only trigger the library update callback, if a query changed at
...
least one row
2017-11-17 19:40:04 +01:00
chme
ea0cc64aa3
[db] Add functions to read/store int64 values in admin table
2017-11-17 18:12:03 +01:00
Wolfgang Scherer
ef767a08a4
[db] Report directory names that end in spaces
2017-11-15 22:25:12 +01:00
ejurgensen
b710d728f8
[db] Add a free_query_params function
2017-11-11 22:20:09 +01:00
ejurgensen
79b2cf4fd7
[db] Log path to db on error, so it's easier to debug
2017-10-29 22:07:58 +01:00
ejurgensen
bf8fa1c3f0
[db] Remove poorly performing and now unused _bymatch() functions
2017-10-17 23:11:31 +02:00
ejurgensen
00b7b97382
[db] Make I_FNAME index case insensitive and search fname using COLLATE NOCASE
...
Also some cleaning up
2017-10-17 23:11:31 +02:00
ejurgensen
88a565ea2c
[db] Replace sqlite3_xxx() calls outside db.c/cache.c so they are abstracted
2017-10-17 23:11:31 +02:00
ejurgensen
659b5c70c4
[db] Faster size check in db.c's db_snprintf()
2017-10-17 23:11:31 +02:00
ejurgensen
47585d0d03
[db] Add methods db_mprintf() and db_snprintf() which wrap sqlite
2017-10-17 23:11:31 +02:00
ejurgensen
4d47307a02
[db/filescanner] Add index on fname, change playlist matching (wip)
2017-10-17 23:11:31 +02:00
ejurgensen
65b4c579f3
[db] Add method db_pl_ping_items_bymatch()
2017-10-17 23:10:21 +02:00
ejurgensen
b9621102f4
[db] Remove db_file_stamp_bypath(), not required any more
2017-10-17 23:10:21 +02:00
ejurgensen
fe731c0993
[db] Add new method db_file_ping_bypath() + cleanup malloc->calloc and char->const char
2017-10-17 23:10:21 +02:00
chme
0b2ee5a9eb
[db/mpd] Simplify getting file count from db
2017-08-27 11:54:32 +02:00
chme
ff4b388d26
[db] Use db_get_one_int in db_pl_id_bypath
2017-08-07 20:13:46 +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
3f10dac2f7
[dacp] Start playback from selected song in shuffle mode ( #379 )
2017-04-17 10:46:24 +02:00
ejurgensen
3a35a51cb9
[db] Align naming of struct query_params pointers et al
2017-04-16 23:54:07 +02:00
chme
f5c65d1eef
[db] Do not notify clients in 'db_queue_add_by_query' if no items were
...
added
2017-03-19 18:30:46 +01:00
chme
cc899651c7
[db] New function to add a media file info as a new queue item
2017-03-19 18:30:46 +01:00
chme
1dde41fb87
[mpd] Fix wrong db playime info in 'stats' command ( #360 )
2017-03-04 17:23:52 +01:00
chme
9c90cbcd12
[db] Fix return value of db_queue_add_by_query
2017-02-26 11:04:04 +01:00
chme
3896f61d06
[dacp] Keep the now playing item in the queue when calling ( #353 )
...
playqueueedit_clear
2017-02-11 09:28:35 +01:00
chme
9680fa093a
[db] Fix mpd command 'delete' removing to many items
...
Previously db_queue_delete_bypos iterated over the items and called
delete for each item. The delete also adjusted the pos/shuffle_pos
values for the remaining items.
A delete of pos = 0 resulted therefor in:
- fetch item with pos = 0
- delete item at pos
- update remaining items to pos = pos - 1
- fetch item with pos = 0 (returns the new item at pos 0)
- delete item at pos
- ...
2017-02-04 08:37:58 +01:00
chme
d293356d8b
[db] Extract function to fix queue position values
2017-02-04 08:37:58 +01:00
chme
1c8263224e
[db] Fix incorrect query for db_queue_delete_bypos
2017-02-04 08:37:58 +01:00
ejurgensen
97aa544945
[library] Move library update trigger to new library module
2017-01-28 22:20:35 +01:00
ejurgensen
4d4a4ffd70
[db] Remove special icy update function, add db_queue_update_item()
...
- we will use the latter generalised form from now on, even though it is perhaps a tad slower
2017-01-27 22:36:00 +01:00
ejurgensen
18918ce489
[db] Rename db_file_save_seek -> db_file_seek_update
2017-01-27 22:35:15 +01:00
ejurgensen
1258481202
[listener] Rename LISTENER_PLAYLIST to LISTENER_QUEUE
2017-01-27 22:25:32 +01:00
ejurgensen
60daf03f66
[cache/scan] Let notifications from db.c about library updates go through
...
filescanner/listener instead of directly to the cache
2017-01-27 22:25:32 +01:00
sshambar
b128271656
Merge branch 'master' into fixthreads
2017-01-21 10:27:26 -05:00
Scott Shambarger
8e3797ec43
[threads] Update mutex/cond functions to use new CHECK_ERR macros
...
Added various macros to check return values and log any errors and abort
if the call fails.
Updated logging to handle early errors before logging initialized.
2017-01-21 07:11:20 -08:00
chme
6163269832
[dacp/db] Fix issue found with scan-build
...
- Result of operation is garbage or undefined in dacp_reply_cue_play
- Uninitialized argument value in dacp_reply_playqueuecontents
- Uninitialized argument value in queue_fetch_byposrelativetoitem
2017-01-20 19:00:11 +01:00
Scott Shambarger
b54d94fda6
[threads] Added missing initializers, check errors on mutex/cond calls
2017-01-13 17:32:59 -05:00
chme
4e60626749
[db] Add missing purge of directories in db_purge_all
2017-01-13 18:56:37 +01:00
chme
ae1a45bacc
[library/spotify] Implement rescan in spotify.c and purge old files
...
after rescan
2017-01-13 18:56:37 +01:00
chme
56ce3f9cba
[library/filescanner/spotify] Add library source abstraction and new
...
"library" thread
- Implement filescanner as a library_source
- Add library source implementation for spotify
- Move process_media_info to library with small adjustments:
- Remove dependency to F_SCAN_TYPE defines
- Pass data_kind as parameter
- Pass media_kind and compilation as parameter if a source forces a
specific value for these
- Move declaration of scan_ffmpeg to library; add
library_add_playlist_info to library
2017-01-13 18:56:37 +01:00
ejurgensen
213b58c012
[db] Forgot to add Q_FIND_PL as a playlist query
2017-01-06 19:58:38 +01:00
ejurgensen
27946a472b
[artwork] Add handler for playlist local artwork (for http items)
...
- ref https://www.raspberrypi.org/forums/viewtopic.php?p=1090166#p1090166
2017-01-06 19:35:05 +01:00
ejurgensen
b7c4256df4
[db] Refactor db_build_query_* to reduce redundancy
2017-01-04 22:29:47 +01:00
chme
be6b4376e8
[db] wrap db_purge_cruft in a transaction
2016-12-27 21:31:01 +01:00
ejurgensen
1748430c48
[db] Review of cache regeneration triggers
2016-12-18 21:18:15 +01:00
ejurgensen
40d34ed4ad
Merge pull request #324 from chme/db3
...
Remove rebuilding the persistent-ids on startup
2016-12-18 11:20:10 +01:00
chme
7856498951
[db] Remove unused functions db_files_update_songartistid,
...
db_files_update_songalbumid
2016-12-17 16:17:23 +01:00
chme
3d3c27190b
[db] Add function to cleanup the 'groups' table (artists and albums)
...
Allows removing of item no longer referenced from the files table
2016-12-17 07:38:47 +01:00
chme
351725c8b2
[db] initialize id parameter with 0
2016-12-17 07:11:43 +01:00
chme
de61a3a851
[db] Remove db_admin_update and rename db_admin_add
2016-12-10 06:15:43 +01:00
chme
c4732b835f
[db] Remove unused function db_file_id_byfilebase
2016-12-09 16:20:50 +01:00
chme
588fe120b7
[db] Rename db_get_count to db_get_one_int
2016-12-09 16:20:03 +01:00
chme
2d1e5f6d60
[player/db] Remove function "db_file_get_seekpos"
2016-12-04 17:48:35 +01:00
chme
d339f5bcd2
[db] fixup
2016-12-04 11:34:54 +01:00
chme
edc609b531
[db] Queue fetch functions should end the query after start and fetch
2016-12-04 09:32:50 +01:00
chme
09c2e7ca76
[db] Add missing free of query_param.filter
2016-12-04 09:16:49 +01:00
chme
fb55960b0a
[db] Remove db_queue_enum struct and use generic query_params
2016-12-04 08:18:33 +01:00
chme
b9117f9abd
[db] Remove unnecessary setting of query param fields to 0
2016-12-04 07:42:38 +01:00
chme
6c6f02fdfa
Rename "queue_item.item_id" to "queue_item.id"
2016-12-03 11:14:03 +01:00
chme
eb896a1085
[db] Fix loglevel
2016-12-03 11:12:19 +01:00
chme
0251f3c514
[db] Rename "queue_add_mediafileinfo" to "queue_add_file"
2016-12-03 11:12:19 +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
6c7df96371
[db] Remove forward declaration of queue_fetch_byitemid
2016-12-03 11:12:19 +01:00
chme
6c66d39d91
[player] Fix segfault if player reaches end of queue, fix repeat single
2016-12-03 11:12:19 +01:00
chme
a0590ce548
[db/player] Icy metadata update
2016-12-03 11:12:19 +01:00
chme
c504abe451
Use queue db table instead of in memory queue struct
2016-12-03 11:11:33 +01:00
chme
8ebf2f9307
[db] Add functions to access/modify the queue table
2016-12-03 10:58:26 +01:00
ejurgensen
3921cf5732
Merge branch 'spwebapi2'
2016-11-27 22:54:06 +01:00
ejurgensen
bb2a73ddab
[spotify] Keep saved tracks through restarts + misc fixing up
2016-11-13 22:13:35 +01:00
chme
2c801ca6db
[db] Small code improvements (avoid hard coded values in query strings)
2016-11-12 12:35:22 +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
ejurgensen
a99d1b2038
[db] Add song_length to group info ( fixes #265 )
2016-06-11 23:10:13 +02:00
ejurgensen
cbaea95ff4
[filescanner] Support for songdatereleased and songhasbeenplayed
2016-03-04 22:37:56 +01:00
chme
c1dcc0a937
[db] Make loading of playlistitem count optional
2016-02-21 18:05:11 +01:00
ejurgensen
bd75281340
[player] Save speaker name and rename raop_ to output_
2016-02-11 20:04:30 +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