Skip to content

Commit

Permalink
Improved auto-hide metadata feature to show only basic metadata and h…
Browse files Browse the repository at this point in the history
…ide custom entries
  • Loading branch information
TT-ReBORN committed Dec 18, 2023
1 parent 0d7124f commit f38474d
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions profile/georgia-reborn/scripts/Base/gr-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,30 +530,16 @@ function drawDetailsMetadataGrid(gr) {

default: {
let matchCount = 0;
// * There is no space for these metadata entries on small player sizes, so hide them
const smallHDRes = pref.displayRes === 'HD' && (ww < 1250 || wh < 800);
const smallQHDRes = pref.displayRes === 'QHD' && (ww < 1350 || wh < 900);
const small4KRes = pref.displayRes === '4K' && (ww < 2350 || wh < 1550);
if (pref.autoHideGridMetadata && pref.layout === 'default' && (smallHDRes || smallQHDRes || small4KRes)) {
switch (key) {
case 'Disc':
case 'Rel. Type':
case 'Rel. Date':
case 'Edition':
case 'Catalog':
case 'Rel. Country':
case 'Added':
case 'Last Played':
case 'Hotness':
case 'View Count':
case 'Likes':
case 'Mood':
case 'Playing List':
value = '';
key = '';
matchCount++;
break;
}
const basicMeta = ['Year', 'Label', 'Genre', 'Codec', 'Channels', 'Source', 'Data', 'Play Count', 'Rating'];

// * On small player sizes, there is no space for all metadata entries. Hide them and only display entries from basicMeta.
if (pref.autoHideGridMetadata && pref.layout === 'default' && (smallHDRes || smallQHDRes || small4KRes) && !basicMeta.includes(key)) {
value = '';
key = '';
matchCount++;
}
gridTop -= cellHeight * matchCount;
}
Expand Down

0 comments on commit f38474d

Please sign in to comment.