Commit Graph

24 Commits

Author SHA1 Message Date
whatdoineed2do 2dc448fa30
[scan/library] Media rating sync (#1681)
Automatically read/write ratings to files in the library, if options read_rating/
write_rating are enabled. Also adds a max_rating so the user can set the rating
scale.

Doesn't sync automatic rating updates, because that could lead to whole-playlist
file rewriting.

Closes #1678 

---------

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: ejurgensen <espenjurgensen@gmail.com>
2024-01-24 23:30:02 +01: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 4082f9e215 [library] Add function to delete playlist by id that directly
invalidates the REST API client caches
2020-11-28 08:27:52 +01:00
ejurgensen 2d8521139c [library] Add action to library_schedule_callback()
Makes it possible for the caller to request that a previous callback is
replaced, so we don't end up with more and more callbacks. Also add other
options for future use.
2020-04-04 21:07:16 +02:00
ejurgensen 2ee5f6d747 [library] Change implementation of item_add, event cb and drop item_remove. 2020-04-04 21:07:16 +02:00
whatdoineed2do/Ray 8b02ea9d6b [library] RSS support: new library interface item_{add.remove} and all library modules to register (timer) events 2020-04-04 21:07:16 +02:00
ejurgensen 5295d787ad [scan] Change library_playlist_save return + fix Spotify
* fix Spotify invalid mem access
* fix clearing of Spotify files
2020-02-08 10:55:15 +01:00
ejurgensen ba1c536ca3 [library] Let library_media_save() return errors 2020-02-08 10:55:15 +01:00
ejurgensen abdc0d6d27 [library] Some refactoring of the library module
Misc refactoring, e.g. alignment of how modules save tracks and playlists, incl
use of mfi and pli. Also try to avoid direct calls between library and player.
2020-02-08 10:55:15 +01:00
whatdoineed2do/Ray 8f311d4360 [library] support forced metadata scan of library, via '.meta-rescan' file 2019-07-09 13:54:59 +02:00
chme a8e8dc1999 [library/db/filescanner/spotify] Reshuffle after adding non library
items to the queue
2018-11-11 07:01:22 +01:00
chme 8d8663e93d [db/queue] Support adding non-library items at a given position to the
queue
2018-10-25 19:36:43 +02:00
chme 60ebac076b Refactor adding non library items to the queue
Instead of asking a client to first scan the path into a media_file_info
object and afterwards add it to the queue, we now offer a library
function to directly add a path.

The library-source that can handle the given path translates the path
into new queue item(s) and adds them to the queue.
2018-04-15 22:09:28 +02:00
chme ef52f4ddc0 Rework user rating updates 2017-12-15 19:08:32 +01:00
chme f84e87913c [library] Allow save/add/delete of playlists if source supports it 2017-08-09 21:30:23 +02:00
chme 888710612c [library] Add missing attribute mapping from mfi to queue item 2017-03-19 18:30:46 +01:00
chme 59ade61d7b [library] Rename constants 2017-03-19 18:30:46 +01:00
chme e6f49b721f [library] New functions to support scan metadata for arbitrary path and
adding a mfi as a queue item
2017-03-19 18:30:46 +01:00
chme bdd08f516f [library] Rename 'library_process_media' to 'library_add_media' 2017-03-19 18:30:46 +01:00
chme dadba23efc Refactor library scan of media files
Remove the data_kind specific parts out of the general library functions
and into their (library) source specific functions.
2017-03-19 18:30:46 +01:00
ejurgensen 97aa544945 [library] Move library update trigger to new library module 2017-01-28 22:20:35 +01:00
chme 9c9c583b81 [library] move declaration scan_metadata_ffmpeg back to filescanner.h 2017-01-13 18:56:37 +01:00
chme adac1d3b5f [spotify] Trigger scan after retrieving a valid access token from the
webinterface

Library now offers the function "library_exec_async". This allows
library sources to offer functions that will be executed in
the library thread. Useful to allow partial scans of only one source.
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