diff --git a/src/components/router/appRouter.js b/src/components/router/appRouter.js index 5688ecd603..e871448160 100644 --- a/src/components/router/appRouter.js +++ b/src/components/router/appRouter.js @@ -673,6 +673,16 @@ class AppRouter { return url; } + if (item === 'tag') { + url = `#/list.html?type=tag&tag=${encodeURIComponent(options.tag)}&serverId=${serverId}`; + + if (options.parentId) { + url += '&parentId=' + options.parentId; + } + + return url; + } + if (context !== 'folders' && !itemHelper.isLocalItem(item)) { if (item.CollectionType == CollectionType.Movies) { url = `#/movies.html?topParentId=${item.Id}&collectionType=${item.CollectionType}`; diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index a2dc24d16e..86ebf163be 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -1313,8 +1313,12 @@ function renderTags(page, item) { } tags.forEach(tag => { + const href = appRouter.getRouteUrl('tag', { + tag, + serverId: item.ServerId + }); tagElements.push( - `` + `` + escapeHtml(tag) + '' ); diff --git a/src/controllers/list.js b/src/controllers/list.js index 5b8039dc9c..b44bac83ba 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -284,7 +284,8 @@ function getItems(instance, params, item, sortBy, startIndex, limit) { Recursive: true, IsFavorite: params.IsFavorite === 'true' || null, ArtistIds: params.artistId || null, - SortBy: sortBy + SortBy: sortBy, + Tags: params.tag || null })); } @@ -333,7 +334,7 @@ function getItems(instance, params, item, sortBy, startIndex, limit) { } function getItem(params) { - if (params.type === 'Recordings' || params.type === 'Programs' || params.type === 'nextup') { + if ([ 'Recordings', 'Programs', 'nextup', 'tag' ].includes(params.type)) { return Promise.resolve(null); } @@ -726,6 +727,10 @@ class ItemsView { if (params.type === 'Video') { return globalize.translate('Videos'); } + + if (params.tag) { + return params.tag; + } } function play() { @@ -1207,7 +1212,7 @@ class ItemsView { showTitle = true; } else if (showTitle === 'false') { showTitle = false; - } else if (params.type === 'Programs' || params.type === 'Recordings' || params.type === 'Person' || params.type === 'nextup' || params.type === 'Audio' || params.type === 'MusicAlbum' || params.type === 'MusicArtist') { + } else if ([ 'Audio', 'MusicAlbum', 'MusicArtist', 'Person', 'Programs', 'Recordings', 'nextup', 'tag' ].includes(params.type)) { showTitle = true; } else if (item && item.Type !== 'PhotoAlbum') { showTitle = true; @@ -1224,7 +1229,7 @@ class ItemsView { } return { - showTitle: showTitle, + showTitle, showYear: userSettings.get(basekey + '-showYear') !== 'false', imageType: imageType || 'primary', viewType: userSettings.get(basekey + '-viewType') || 'images'