mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-26 20:38:48 -05:00
[db/filescanner/spotify] Replace filelist-view with separate
directories-table to increase the performance of the mpd command 'lsinfo'
This commit is contained in:
@@ -74,7 +74,7 @@ extinf_get(char *string, struct media_file_info *mfi, int *extinf)
|
||||
}
|
||||
|
||||
void
|
||||
scan_playlist(char *file, time_t mtime)
|
||||
scan_playlist(char *file, time_t mtime, int dir_id)
|
||||
{
|
||||
FILE *fp;
|
||||
struct media_file_info mfi;
|
||||
@@ -93,6 +93,7 @@ scan_playlist(char *file, time_t mtime)
|
||||
int ret;
|
||||
char virtual_path[PATH_MAX];
|
||||
int i;
|
||||
int di_id;
|
||||
|
||||
DPRINTF(E_LOG, L_SCAN, "Processing static playlist: %s\n", file);
|
||||
|
||||
@@ -172,6 +173,8 @@ scan_playlist(char *file, time_t mtime)
|
||||
*ptr = '\0';
|
||||
pli->virtual_path = strdup(virtual_path);
|
||||
|
||||
pli->directory_id = dir_id;
|
||||
|
||||
ret = db_pl_add(pli, &pl_id);
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -236,7 +239,14 @@ scan_playlist(char *file, time_t mtime)
|
||||
if (extinf)
|
||||
DPRINTF(E_INFO, L_SCAN, "Playlist has EXTINF metadata, artist is '%s', title is '%s'\n", mfi.artist, mfi.title);
|
||||
|
||||
filescanner_process_media(filename, mtime, 0, F_SCAN_TYPE_URL, &mfi);
|
||||
di_id = db_directory_addorupdate("/http:", 0, 1);
|
||||
|
||||
if (di_id <= 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SCAN, "Insert or update of directory failed '/http:'\n");
|
||||
}
|
||||
|
||||
filescanner_process_media(filename, mtime, 0, F_SCAN_TYPE_URL, &mfi, di_id);
|
||||
}
|
||||
/* Regular file, should already be in library */
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user