1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #6020 from thornbill/tag-list-view

This commit is contained in:
Bill Thornton 2024-09-07 21:57:22 -04:00 committed by GitHub
commit ee29a98aef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 5 deletions

View file

@ -673,6 +673,16 @@ class AppRouter {
return url; 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 (context !== 'folders' && !itemHelper.isLocalItem(item)) {
if (item.CollectionType == CollectionType.Movies) { if (item.CollectionType == CollectionType.Movies) {
url = `#/movies.html?topParentId=${item.Id}&collectionType=${item.CollectionType}`; url = `#/movies.html?topParentId=${item.Id}&collectionType=${item.CollectionType}`;

View file

@ -1313,8 +1313,12 @@ function renderTags(page, item) {
} }
tags.forEach(tag => { tags.forEach(tag => {
const href = appRouter.getRouteUrl('tag', {
tag,
serverId: item.ServerId
});
tagElements.push( tagElements.push(
`<a href="#/search.html?query=${encodeURIComponent(tag)}" class="button-link emby-button" is="emby-linkbutton">` `<a href="${href}" class="button-link emby-button" is="emby-linkbutton">`
+ escapeHtml(tag) + escapeHtml(tag)
+ '</a>' + '</a>'
); );

View file

@ -284,7 +284,8 @@ function getItems(instance, params, item, sortBy, startIndex, limit) {
Recursive: true, Recursive: true,
IsFavorite: params.IsFavorite === 'true' || null, IsFavorite: params.IsFavorite === 'true' || null,
ArtistIds: params.artistId || 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) { 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); return Promise.resolve(null);
} }
@ -726,6 +727,10 @@ class ItemsView {
if (params.type === 'Video') { if (params.type === 'Video') {
return globalize.translate('Videos'); return globalize.translate('Videos');
} }
if (params.tag) {
return params.tag;
}
} }
function play() { function play() {
@ -1207,7 +1212,7 @@ class ItemsView {
showTitle = true; showTitle = true;
} else if (showTitle === 'false') { } else if (showTitle === 'false') {
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; showTitle = true;
} else if (item && item.Type !== 'PhotoAlbum') { } else if (item && item.Type !== 'PhotoAlbum') {
showTitle = true; showTitle = true;
@ -1224,7 +1229,7 @@ class ItemsView {
} }
return { return {
showTitle: showTitle, showTitle,
showYear: userSettings.get(basekey + '-showYear') !== 'false', showYear: userSettings.get(basekey + '-showYear') !== 'false',
imageType: imageType || 'primary', imageType: imageType || 'primary',
viewType: userSettings.get(basekey + '-viewType') || 'images' viewType: userSettings.get(basekey + '-viewType') || 'images'