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.
This commit is contained in:
chme
2018-03-09 19:03:43 +01:00
committed by ejurgensen
parent acd5bd3272
commit 60ebac076b
6 changed files with 516 additions and 427 deletions

View File

@@ -454,6 +454,12 @@ struct db_queue_item
uint32_t queue_version;
};
struct db_queue_add_info
{
int queue_version;
int pos;
};
char *
db_escape_string(const char *str); // TODO Remove this, use db_mprintf instead
@@ -484,6 +490,9 @@ free_queue_item(struct db_queue_item *queue_item, int content_only);
void
unicode_fixup_mfi(struct media_file_info *mfi);
void
fixup_tags_mfi(struct media_file_info *mfi);
/* Maintenance and DB hygiene */
void
db_hook_post_scan(void);
@@ -764,7 +773,13 @@ int
db_queue_add_by_fileid(int id, char reshuffle, uint32_t item_id);
int
db_queue_add_item(struct db_queue_item *queue_item, char reshuffle, uint32_t item_id);
db_queue_add_start(struct db_queue_add_info *queue_add_info);
void
db_queue_add_end(struct db_queue_add_info *queue_add_info, int ret);
int
db_queue_add_item(struct db_queue_add_info *queue_add_info, struct db_queue_item *item);
int
db_queue_enum_start(struct query_params *qp);