mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-12 23:01:44 -05:00
Use enum values for data_kind and media_kind
This commit is contained in:
@@ -537,7 +537,7 @@ fixup_tags(struct media_file_info *mfi)
|
||||
/* Handle TV shows, try to present prettier metadata */
|
||||
if (mfi->tv_series_name && strlen(mfi->tv_series_name) != 0)
|
||||
{
|
||||
mfi->media_kind = 64; /* tv show */
|
||||
mfi->media_kind = MEDIA_KIND_TVSHOW; /* tv show */
|
||||
|
||||
/* Default to artist = series_name */
|
||||
if (mfi->artist && strlen(mfi->artist) == 0)
|
||||
@@ -608,7 +608,7 @@ fixup_tags(struct media_file_info *mfi)
|
||||
mfi->album_artist_sort = strdup("");
|
||||
}
|
||||
}
|
||||
else if (mfi->media_kind == 4) /* Podcast */
|
||||
else if (mfi->media_kind == MEDIA_KIND_PODCAST) /* Podcast */
|
||||
{
|
||||
if (mfi->album_artist)
|
||||
free(mfi->album_artist);
|
||||
@@ -691,12 +691,12 @@ filescanner_process_media(char *path, time_t mtime, off_t size, int type, struct
|
||||
|
||||
if (type & F_SCAN_TYPE_FILE)
|
||||
{
|
||||
mfi->data_kind = 0; /* real file */
|
||||
mfi->data_kind = DATA_KIND_FILE; /* real file */
|
||||
ret = scan_metadata_ffmpeg(path, mfi);
|
||||
}
|
||||
else if (type & F_SCAN_TYPE_URL)
|
||||
{
|
||||
mfi->data_kind = 1; /* url/stream */
|
||||
mfi->data_kind = DATA_KIND_URL; /* url/stream */
|
||||
ret = scan_metadata_ffmpeg(path, mfi);
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -709,12 +709,12 @@ filescanner_process_media(char *path, time_t mtime, off_t size, int type, struct
|
||||
}
|
||||
else if (type & F_SCAN_TYPE_SPOTIFY)
|
||||
{
|
||||
mfi->data_kind = 2; /* iTunes has no spotify data kind, but we use 2 */
|
||||
mfi->data_kind = DATA_KIND_SPOTIFY; /* iTunes has no spotify data kind, but we use 2 */
|
||||
ret = mfi->artist && mfi->album && mfi->title;
|
||||
}
|
||||
else if (type & F_SCAN_TYPE_PIPE)
|
||||
{
|
||||
mfi->data_kind = 3; /* iTunes has no pipe data kind, but we use 3 */
|
||||
mfi->data_kind = DATA_KIND_PIPE; /* iTunes has no pipe data kind, but we use 3 */
|
||||
mfi->type = strdup("wav");
|
||||
mfi->codectype = strdup("wav");
|
||||
mfi->description = strdup("PCM16 pipe");
|
||||
@@ -735,14 +735,14 @@ filescanner_process_media(char *path, time_t mtime, off_t size, int type, struct
|
||||
if (type & F_SCAN_TYPE_COMPILATION)
|
||||
mfi->compilation = 1;
|
||||
if (type & F_SCAN_TYPE_PODCAST)
|
||||
mfi->media_kind = 4; /* podcast */
|
||||
mfi->media_kind = MEDIA_KIND_PODCAST; /* podcast */
|
||||
if (type & F_SCAN_TYPE_AUDIOBOOK)
|
||||
mfi->media_kind = 8; /* audiobook */
|
||||
mfi->media_kind = MEDIA_KIND_AUDIOBOOK; /* audiobook */
|
||||
|
||||
if (!mfi->item_kind)
|
||||
mfi->item_kind = 2; /* music */
|
||||
if (!mfi->media_kind)
|
||||
mfi->media_kind = 1; /* music */
|
||||
mfi->media_kind = MEDIA_KIND_MUSIC; /* music */
|
||||
|
||||
unicode_fixup_mfi(mfi);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user