Compare commits

...

54 Commits

Author SHA1 Message Date
CodeDevMLH
14a5075e22 Update manifest.json for release v1.5.0.21 [skip ci] 2026-02-09 22:29:09 +00:00
CodeDevMLH
accb316a81 Bump version to 1.5.0.21 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-09 23:28:15 +01:00
CodeDevMLH
51c5cdf5bf Update manifest.json for release v1.5.0.20 [skip ci] 2026-02-09 16:53:01 +00:00
CodeDevMLH
306eff757b Update changelog formatting for version 1.5.0.20
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-09 17:52:10 +01:00
CodeDevMLH
b8f28a5735 Bump version to 1.5.0.20 and update changelog for recent changes
Some checks failed
Auto Release Plugin / build-and-release (push) Has been cancelled
2026-02-09 17:49:36 +01:00
CodeDevMLH
0932d9611d Update manifest.json for release v1.5.0.19 [skip ci] 2026-02-09 16:33:56 +00:00
CodeDevMLH
5e616db0ae Bump version to 1.5.0.19 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 57s
2026-02-09 17:32:59 +01:00
CodeDevMLH
538b0f2110 Update manifest.json for release v1.5.0.18 [skip ci] 2026-02-09 16:21:43 +00:00
CodeDevMLH
e717c07c54 Bump version to 1.5.0.18 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 1m2s
2026-02-09 17:20:40 +01:00
CodeDevMLH
0fa2d01ca3 Update manifest.json for release v1.5.0.17 [skip ci] 2026-02-09 16:05:12 +00:00
CodeDevMLH
5299b2a9d5 Bump version to 1.5.0.17 and update changelog for recent changes
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 57s
2026-02-09 17:04:15 +01:00
CodeDevMLH
4f244988b9 Update manifest.json for release v1.5.0.16 [skip ci] 2026-02-09 15:54:25 +00:00
CodeDevMLH
5635a8f05e Bump version to 1.5.0.16 and update changelog for keyboard controls and sorting options
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 16:53:33 +01:00
CodeDevMLH
c901da4b0c Update manifest.json for release v1.5.0.15 [skip ci] 2026-02-09 15:41:45 +00:00
CodeDevMLH
c45cd0281f Bump version to 1.5.0.15 in project file and manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-09 16:40:24 +01:00
CodeDevMLH
0c3e74829a Remove upstream trailer layout feature from configuration and UI 2026-02-09 16:40:01 +01:00
CodeDevMLH
e6b769f099 Update manifest.json for release v1.5.0.14 [skip ci] 2026-02-09 15:30:53 +00:00
CodeDevMLH
77371f7b98 Bump version to 1.5.0.14 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 58s
2026-02-09 16:29:56 +01:00
CodeDevMLH
988b800b6d Update manifest.json for release v1.5.0.13 [skip ci] 2026-02-09 15:21:45 +00:00
CodeDevMLH
4c6514ba9f Bump version to 1.5.0.13 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 16:20:52 +01:00
CodeDevMLH
6910eba7d6 Update manifest.json for release v1.5.0.12 [skip ci] 2026-02-09 15:10:07 +00:00
CodeDevMLH
3585b47b6c Bump version to 1.5.0.12 and update changelog in manifest.json
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 56s
2026-02-09 16:09:10 +01:00
CodeDevMLH
8170abdc94 Update manifest.json for release v1.5.0.11 [skip ci] 2026-02-09 14:56:05 +00:00
CodeDevMLH
535c0e17bf Add upstream trailer layout feature and update version to 1.5.0.11
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-09 15:55:14 +01:00
CodeDevMLH
df1cee0eeb Update manifest.json for release v1.5.0.10 [skip ci] 2026-02-09 13:31:00 +00:00
CodeDevMLH
16cc56030f Bump version to 1.5.0.10 in project file and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-09 14:30:05 +01:00
CodeDevMLH
13ecbac96e Update manifest.json for release v1.5.0.9 [skip ci] 2026-02-09 13:18:30 +00:00
CodeDevMLH
8bca6f9052 Bump version to 1.5.0.9 in project file and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 54s
2026-02-09 14:17:38 +01:00
CodeDevMLH
217db2a66d Fix video backdrop styling for full coverage and pointer events 2026-02-09 14:17:22 +01:00
CodeDevMLH
5fd7bcb8b6 Update manifest.json for release v1.5.0.8 [skip ci] 2026-02-09 13:11:30 +00:00
CodeDevMLH
0b0e41a9f9 Bump version to 1.5.0.8 in project file and manifest
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 56s
2026-02-09 14:10:35 +01:00
CodeDevMLH
370db55714 Enhance slideshow video styling for better positioning and responsiveness 2026-02-09 14:06:18 +01:00
CodeDevMLH
e5d4800ef1 Update manifest.json for release v1.5.0.7 [skip ci] 2026-02-09 12:28:45 +00:00
CodeDevMLH
b910e92364 Add spotlight.html: Initial implementation of Seth's Spotlight UI enhancement for Jellyfin with movie slideshow and trailer functionality
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 55s
2026-02-09 13:27:51 +01:00
CodeDevMLH
82283b1faf Merge branch 'main' of ssh://git.mahom03-spacecloud.de:44322/CodeDevMLH/jellyfin-plugin-media-bar-enhanced
Some checks failed
Auto Release Plugin / build-and-release (push) Has been cancelled
2026-02-09 13:27:36 +01:00
CodeDevMLH
1588b1a6b2 Add option to prefer local trailers over remote ones; update configuration and UI 2026-02-09 03:31:05 +01:00
CodeDevMLH
de19466341 Add script to fetch specific item details from Jellyfin API 2026-02-09 02:56:53 +01:00
CodeDevMLH
15054e314c refine sorting options description 2026-02-09 02:42:23 +01:00
CodeDevMLH
3877f96b09 Add sorting options for Production Year and Critic Rating; remove Date Created sorting 2026-02-09 02:39:42 +01:00
CodeDevMLH
abca7cb3b6 Refactor random item fetching logic and enhance error handling; add JSON download feature 2026-02-09 02:39:32 +01:00
CodeDevMLH
998a0cfc68 Add scripts to fetch random items from Jellyfin API with detailed logging [skip ci] 2026-02-09 02:21:12 +01:00
CodeDevMLH
63be8214d0 Update manifest.json for release v1.5.0.6 [skip ci] 2026-02-09 00:31:35 +00:00
CodeDevMLH
99411afffd Bump version to 1.5.0.6; update changelog and fix keyboard controls in TV mode
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 58s
2026-02-09 01:30:36 +01:00
CodeDevMLH
9510ae6ba7 Add sorting options for content in configuration and update sorting logic 2026-02-09 01:30:28 +01:00
CodeDevMLH
2030538acc Update manifest.json for release v1.5.0.5 [skip ci] 2026-02-08 02:20:04 +00:00
CodeDevMLH
463e9ef424 Bump version to 1.5.0.5; update keyboard controls and changelog
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 51s
2026-02-08 03:19:12 +01:00
CodeDevMLH
dbe9ce97d2 Update manifest.json for release v1.5.0.4 [skip ci] 2026-02-08 01:32:40 +00:00
CodeDevMLH
45c780c018 Bump version to 1.5.0.4 and update changelog for mediaBarEnhanced.js and manifest.json; enhance keyboard navigation controls
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-02-08 02:31:49 +01:00
CodeDevMLH
9de268caa7 , 2026-02-08 02:28:06 +01:00
CodeDevMLH
a8298461f9 Update manifest.json for release v1.5.0.3 [skip ci] 2026-02-08 00:41:45 +00:00
CodeDevMLH
aa369e5c7b Merge branch 'main' of ssh://git.mahom03-spacecloud.de:44322/CodeDevMLH/jellyfin-plugin-media-bar-enhanced
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 53s
2026-02-08 01:40:53 +01:00
CodeDevMLH
f62dc853be Bump version to 1.5.0.3 and update changelog for mediaBarEnhanced.js and manifest.json; improve keyboard controls in TV mode 2026-02-08 01:40:50 +01:00
CodeDevMLH
d0a7f5da8c Update manifest.json for release v1.5.0.2 [skip ci] 2026-02-08 00:10:29 +00:00
CodeDevMLH
1f140fd3c1 Bump version to 1.5.0.2 and update changelog for mediaBarEnhanced.js and manifest.json; enhance keyboard controls in TV mode
All checks were successful
Auto Release Plugin / build-and-release (push) Successful in 52s
2026-02-08 01:09:38 +01:00
9 changed files with 331 additions and 41 deletions

View File

@@ -21,6 +21,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Configuration
public bool SlideAnimationEnabled { get; set; } = true; public bool SlideAnimationEnabled { get; set; } = true;
public bool EnableVideoBackdrop { get; set; } = true; public bool EnableVideoBackdrop { get; set; } = true;
public bool UseSponsorBlock { get; set; } = true; public bool UseSponsorBlock { get; set; } = true;
public bool PreferLocalTrailers { get; set; } = false;
public bool WaitForTrailerToEnd { get; set; } = true; public bool WaitForTrailerToEnd { get; set; } = true;
public bool StartMuted { get; set; } = true; public bool StartMuted { get; set; } = true;
public bool FullWidthVideo { get; set; } = true; public bool FullWidthVideo { get; set; } = true;
@@ -35,5 +36,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Configuration
public bool EnableSeasonalContent { get; set; } = false; public bool EnableSeasonalContent { get; set; } = false;
public bool IsEnabled { get; set; } = true; public bool IsEnabled { get; set; } = true;
public bool EnableClientSideSettings { get; set; } = false; public bool EnableClientSideSettings { get; set; } = false;
public string SortBy { get; set; } = "Random";
public string SortOrder { get; set; } = "Ascending";
} }
} }

View File

@@ -57,6 +57,14 @@
<div class="fieldDescription">Show trailers as background if available.<br>Adds a <div class="fieldDescription">Show trailers as background if available.<br>Adds a
mute/unmute and pause/play button to control the video in the right top corner.</div> mute/unmute and pause/play button to control the video in the right top corner.</div>
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription" id="PreferLocalTrailersContainer">
<label>
<input is="emby-checkbox" type="checkbox" id="PreferLocalTrailers"
name="PreferLocalTrailers" />
<span>Prefer Local Trailers</span>
</label>
<div class="fieldDescription">If enabled, local trailers will be preferred over remote (YouTube) trailers.</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription"> <div class="checkboxContainer checkboxContainer-withDescription">
<label> <label>
<input is="emby-checkbox" type="checkbox" id="WaitForTrailerToEnd" <input is="emby-checkbox" type="checkbox" id="WaitForTrailerToEnd"
@@ -274,6 +282,33 @@
mobile).</div> mobile).</div>
</div> </div>
<h2 class="sectionTitle">Content Sorting</h2>
<div class="selectContainer">
<label class="selectLabel" for="SortBy">Sort By</label>
<select is="emby-select" id="SortBy" name="SortBy" class="emby-select-withcolor emby-select">
<option value="Random">Random</option>
<option value="Original">Original (Custom List Order)</option>
<option value="PremiereDate">Premiere Date</option>
<option value="ProductionYear">Production Year</option>
<option value="CriticRating">Critic Rating</option>
<option value="CommunityRating">Community Rating</option>
<option value="Name">Name</option>
<option value="Runtime">Runtime</option>
</select>
<div class="fieldDescription">Sort items by the selected criteria.</div>
</div>
<div class="selectContainer">
<label class="selectLabel" for="SortOrder">Sort Order</label>
<select is="emby-select" id="SortOrder" name="SortOrder" class="emby-select-withcolor emby-select">
<option value="Ascending">Ascending</option>
<option value="Descending">Descending</option>
</select>
<div class="fieldDescription">Sort items in Ascending or Descending order.</div>
</div>
<div class="fieldDescription" style="margin-bottom: 2em; color: #ffcc00;">
<b>Note:</b> Sorting settings apply to both Server content and Custom IDs. 'Original' preserves Custom List order.
</div>
<h2 class="sectionTitle">Content Limits</h2> <h2 class="sectionTitle">Content Limits</h2>
<p>Leave a setting blank to use the default value.</p> <p>Leave a setting blank to use the default value.</p>
<div class="inputContainer"> <div class="inputContainer">
@@ -370,7 +405,8 @@
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo', 'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls', 'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen', 'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
'EnableSeasonalContent', 'EnableClientSideSettings' 'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
'PreferLocalTrailers'
]; ];
keys.forEach(function (key) { keys.forEach(function (key) {
@@ -404,6 +440,23 @@
updateDesc(); updateDesc();
} }
// Handle Prefer Local Trailers visibility
var enableVideoBackdropCheckbox = page.querySelector('#EnableVideoBackdrop');
var preferLocalContainer = page.querySelector('#PreferLocalTrailersContainer');
function updatePreferLocalVisibility() {
if (enableVideoBackdropCheckbox && enableVideoBackdropCheckbox.checked) {
if (preferLocalContainer) preferLocalContainer.style.display = 'block';
} else {
if (preferLocalContainer) preferLocalContainer.style.display = 'none';
}
}
if (enableVideoBackdropCheckbox) {
enableVideoBackdropCheckbox.addEventListener('change', updatePreferLocalVisibility);
updatePreferLocalVisibility();
}
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
}, },
@@ -419,7 +472,8 @@
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo', 'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls', 'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen', 'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
'EnableSeasonalContent', 'EnableClientSideSettings' 'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
'PreferLocalTrailers'
]; ];
keys.forEach(function (key) { keys.forEach(function (key) {

View File

@@ -12,7 +12,7 @@
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> --> <!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
<Title>Jellyfin Media Bar Enhanced Plugin</Title> <Title>Jellyfin Media Bar Enhanced Plugin</Title>
<Authors>CodeDevMLH</Authors> <Authors>CodeDevMLH</Authors>
<Version>1.5.0.1</Version> <Version>1.5.0.21</Version>
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl> <RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
</PropertyGroup> </PropertyGroup>

View File

@@ -161,7 +161,7 @@
.homeSectionsContainer { .homeSectionsContainer {
position: relative; position: relative;
top: 65vh; margin-top: 65vh;
z-index: 6; z-index: 6;
} }

View File

@@ -38,6 +38,7 @@ const CONFIG = {
slideAnimationEnabled: true, slideAnimationEnabled: true,
enableVideoBackdrop: true, enableVideoBackdrop: true,
useSponsorBlock: true, useSponsorBlock: true,
preferLocalTrailers: false,
waitForTrailerToEnd: true, waitForTrailerToEnd: true,
startMuted: true, startMuted: true,
fullWidthVideo: true, fullWidthVideo: true,
@@ -51,6 +52,8 @@ const CONFIG = {
customMediaIds: "", customMediaIds: "",
enableLoadingScreen: true, enableLoadingScreen: true,
enableClientSideSettings: false, enableClientSideSettings: false,
sortBy: "Random",
sortOrder: "Ascending",
}; };
// State management // State management
@@ -460,6 +463,66 @@ waitForApiClientAndInitialize();
* Utility functions for slide creation and management * Utility functions for slide creation and management
*/ */
const SlideUtils = { const SlideUtils = {
/**
* Sorts items based on configuration
* @param {Array<Object>} items - Array of item objects
* @param {string} sortBy - Sort criteria
* @param {string} sortOrder - Sort order 'Ascending' or 'Descending'
* @returns {Array<Object>} Sorted array of items
*/
sortItems(items, sortBy, sortOrder) {
if (sortBy === 'Random' || sortBy === 'Original') {
return items;
}
const simpleCompare = (a, b) => {
if (a < b) return -1;
if (a > b) return 1;
return 0;
};
const sorted = [...items].sort((a, b) => {
let valA, valB;
switch (sortBy) {
case 'PremiereDate':
valA = new Date(a.PremiereDate).getTime();
valB = new Date(b.PremiereDate).getTime();
break;
case 'ProductionYear':
valA = a.ProductionYear || 0;
valB = b.ProductionYear || 0;
break;
case 'CriticRating':
valA = a.CriticRating || 0;
valB = b.CriticRating || 0;
break;
case 'CommunityRating':
valA = a.CommunityRating || 0;
valB = b.CommunityRating || 0;
break;
case 'Runtime':
valA = a.RunTimeTicks || 0;
valB = b.RunTimeTicks || 0;
break;
case 'Name':
valA = (a.Name || '').toLowerCase();
valB = (b.Name || '').toLowerCase();
break;
default:
return 0;
}
return simpleCompare(valA, valB);
});
if (sortOrder === 'Descending') {
sorted.reverse();
}
return sorted;
},
/** /**
* Shuffles array elements randomly * Shuffles array elements randomly
* @param {Array} array - Array to shuffle * @param {Array} array - Array to shuffle
@@ -542,7 +605,10 @@ const SlideUtils = {
getOrCreateSlidesContainer() { getOrCreateSlidesContainer() {
let container = document.getElementById("slides-container"); let container = document.getElementById("slides-container");
if (!container) { if (!container) {
container = this.createElement("div", { id: "slides-container" }); container = this.createElement("div", {
id: "slides-container",
className: "noautofocus"
});
document.body.appendChild(container); document.body.appendChild(container);
} }
return container; return container;
@@ -960,8 +1026,8 @@ const ApiUtils = {
} }
const response = await fetch( const response = await fetch(
`${STATE.jellyfinData.serverAddress}/Items/${itemId}`, // `${STATE.jellyfinData.serverAddress}/Items/${itemId}`,
// `${STATE.jellyfinData.serverAddress}/Users/${STATE.jellyfinData.userId}/Items/${itemId}?Fields=Overview,RemoteTrailers,Genres,CommunityRating,CriticRating,OfficialRating,PremiereDate,RunTimeTicks,ProductionYear,MediaSources`, `${STATE.jellyfinData.serverAddress}/Items/${itemId}?Fields=Overview,RemoteTrailers,Genres,CommunityRating,CriticRating,OfficialRating,PremiereDate,ProductionYear,MediaSources,RunTimeTicks,LocalTrailerCount`,
{ {
headers: this.getAuthHeaders(), headers: this.getAuthHeaders(),
} }
@@ -1033,8 +1099,16 @@ const ApiUtils = {
console.log("Fetching random items from server..."); console.log("Fetching random items from server...");
let sortParams = `sortBy=${CONFIG.sortBy}`;
if (CONFIG.sortBy === 'Random' || CONFIG.sortBy === 'Original') {
sortParams = 'sortBy=Random';
} else {
sortParams += `&sortOrder=${CONFIG.sortOrder}`;
}
const response = await fetch( const response = await fetch(
`${STATE.jellyfinData.serverAddress}/Items?IncludeItemTypes=Movie,Series&Recursive=true&hasOverview=true&imageTypes=Logo,Backdrop&sortBy=Random&isPlayed=False&enableUserData=true&Limit=${CONFIG.maxItems}&fields=Id`, `${STATE.jellyfinData.serverAddress}/Items?IncludeItemTypes=Movie,Series&Recursive=true&hasOverview=true&imageTypes=Logo,Backdrop&${sortParams}&isPlayed=False&enableUserData=true&Limit=${CONFIG.maxItems}&fields=Id`,
{ {
headers: this.getAuthHeaders(), headers: this.getAuthHeaders(),
} }
@@ -1253,6 +1327,39 @@ const ApiUtils = {
console.error(`Error fetching collection items for ${collectionId}:`, error); console.error(`Error fetching collection items for ${collectionId}:`, error);
return []; return [];
} }
},
/**
* Fetches the first local trailer for an item
* @param {string} itemId - Item ID
* @returns {Promise<string|null>} Stream URL or null
*/
async fetchLocalTrailer(itemId) {
try {
const response = await fetch(
`${STATE.jellyfinData.serverAddress}/Users/${STATE.jellyfinData.userId}/Items/${itemId}/LocalTrailers`,
{
headers: this.getAuthHeaders(),
}
);
if (!response.ok) {
return null;
}
const trailers = await response.json();
if (trailers && trailers.length > 0) {
const trailer = trailers[0];
const mediaSourceId = trailer.MediaSources && trailer.MediaSources[0] ? trailer.MediaSources[0].Id : trailer.Id;
// Construct stream URL
return `${STATE.jellyfinData.serverAddress}/Videos/${trailer.Id}/stream.mp4?Static=true&mediaSourceId=${mediaSourceId}&api_key=${STATE.jellyfinData.accessToken}`;
}
return null;
} catch (error) {
console.error(`Error fetching local trailer for ${itemId}:`, error);
return null;
}
} }
}; };
@@ -1435,12 +1542,21 @@ const SlideCreator = {
let isVideo = false; let isVideo = false;
let trailerUrl = null; let trailerUrl = null;
// 1. Check for Remote Trailers (YouTube) // 1. Check for Remote/Local Trailers
// Priority: Custom Config URL > Metadata RemoteTrailer // Priority: Custom Config URL > (PreferLocal -> Local) > Metadata RemoteTrailer
// 1a. Custom URL override
if (STATE.slideshow.customTrailerUrls && STATE.slideshow.customTrailerUrls[itemId]) { if (STATE.slideshow.customTrailerUrls && STATE.slideshow.customTrailerUrls[itemId]) {
trailerUrl = STATE.slideshow.customTrailerUrls[itemId]; trailerUrl = STATE.slideshow.customTrailerUrls[itemId];
console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`); console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`);
} else if (item.RemoteTrailers && item.RemoteTrailers.length > 0) { }
// 1b. Check Local Trailer if preferred
else if (CONFIG.preferLocalTrailers && item.LocalTrailerCount > 0 && item.localTrailerUrl) {
trailerUrl = item.localTrailerUrl;
console.log(`Using local trailer for ${itemId}: ${trailerUrl}`);
}
// 1c. Fallback to Remote Trailer
else if (item.RemoteTrailers && item.RemoteTrailers.length > 0) {
trailerUrl = item.RemoteTrailers[0].Url; trailerUrl = item.RemoteTrailers[0].Url;
} }
@@ -1592,7 +1708,7 @@ const SlideCreator = {
autoplay: false, autoplay: false,
preload: "auto", preload: "auto",
loop: false, loop: false,
style: "object-fit: cover; width: 100%; height: 100%; pointer-events: none;" style: "object-fit: cover; object-position: center center; width: 100%; height: 100%; position: absolute; top: 0; left: 0; pointer-events: none;"
}; };
if (STATE.slideshow.isMuted) { if (STATE.slideshow.isMuted) {
@@ -1934,6 +2050,11 @@ const SlideCreator = {
const item = await ApiUtils.fetchItemDetails(itemId); const item = await ApiUtils.fetchItemDetails(itemId);
// Pre-fetch local trailer URL if needed
if (CONFIG.preferLocalTrailers && item.LocalTrailerCount > 0) {
item.localTrailerUrl = await ApiUtils.fetchLocalTrailer(itemId);
}
const slideElement = this.createSlideElement( const slideElement = this.createSlideElement(
item, item,
item.Type === "Movie" ? "Movie" : "TV Show" item.Type === "Movie" ? "Movie" : "TV Show"
@@ -2533,56 +2654,58 @@ const SlideshowManager = {
document.addEventListener("keydown", (e) => { document.addEventListener("keydown", (e) => {
const container = document.getElementById("slides-container"); const container = document.getElementById("slides-container");
// Allow interaction if container is visible, even if not strictly focused
if (!container || container.style.display === "none") { if (!container || container.style.display === "none") {
return; return;
} }
// Only trap keys if focus is on body (neutral) or inside our container. const activeElement = document.activeElement;
// To allow standard TV navigation to work for other elements (e.g. library cards). const isSlideshowFocused = container.contains(activeElement) || activeElement === container;
const activeEl = document.activeElement;
const isBody = activeEl === document.body || !activeEl;
const isInContainer = container.contains(activeEl) || activeEl === container;
if (!isBody && !isInContainer) { const isTvMode = window.layoutManager && window.layoutManager.tv;
const isInputElement = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
if (isInputElement) {
return; return;
} }
const focusElement = document.activeElement;
switch (e.key) { switch (e.key) {
case "ArrowRight": case "ArrowRight":
if (focusElement && focusElement.classList.contains("detail-button")) { if (isTvMode && !isSlideshowFocused) return;
focusElement.previousElementSibling.focus(); SlideshowManager.nextSlide();
} else {
SlideshowManager.nextSlide();
}
e.preventDefault(); e.preventDefault();
break; break;
case "ArrowLeft": case "ArrowLeft":
if (focusElement && focusElement.classList.contains("play-button")) { if (isTvMode && !isSlideshowFocused) return;
focusElement.nextElementSibling.focus(); SlideshowManager.prevSlide();
} else {
SlideshowManager.prevSlide();
}
e.preventDefault(); e.preventDefault();
break; break;
case " ": // Space bar case " ": // Space bar
if (isTvMode && !isSlideshowFocused) return;
this.togglePause(); this.togglePause();
e.preventDefault(); e.preventDefault();
break; break;
case "m": // Mute toggle case "m": // Mute toggle
case "M": case "M":
if (isTvMode && !isSlideshowFocused) return;
this.toggleMute(); this.toggleMute();
e.preventDefault(); e.preventDefault();
break; break;
case "Enter": case "Enter":
if (focusElement) { if (!isSlideshowFocused) return;
focusElement.click(); const currentItemId = STATE.slideshow.itemIds[STATE.slideshow.currentSlideIndex];
if (currentItemId) {
if (window.Emby && window.Emby.Page) {
Emby.Page.show(
`/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`
);
} else {
window.location.href = `#/details?id=${currentItemId}&serverId=${STATE.jellyfinData.serverId}`;
}
} }
e.preventDefault(); e.preventDefault();
break; break;
@@ -2776,9 +2899,27 @@ const SlideshowManager = {
if (itemIds.length === 0) { if (itemIds.length === 0) {
console.log("No custom list found, fetching random items from server..."); console.log("No custom list found, fetching random items from server...");
itemIds = await ApiUtils.fetchItemIdsFromServer(); itemIds = await ApiUtils.fetchItemIdsFromServer();
}
itemIds = SlideUtils.shuffleArray(itemIds); if (CONFIG.sortBy === 'Random') {
itemIds = SlideUtils.shuffleArray(itemIds);
}
} else {
// Custom IDs
if (CONFIG.sortBy === 'Random') {
itemIds = SlideUtils.shuffleArray(itemIds);
} else if (CONFIG.sortBy !== 'Original') {
// Client-side sort required...
console.log(`Sorting ${itemIds.length} custom items by ${CONFIG.sortBy} ${CONFIG.sortOrder}`);
const itemsWithDetails = [];
for (const id of itemIds) {
const item = await ApiUtils.fetchItemDetails(id);
if (item) itemsWithDetails.push(item);
}
const sortedItems = SlideUtils.sortItems(itemsWithDetails, CONFIG.sortBy, CONFIG.sortOrder);
itemIds = sortedItems.map(i => i.Id);
}
}
STATE.slideshow.itemIds = itemIds; STATE.slideshow.itemIds = itemIds;
STATE.slideshow.totalItems = itemIds.length; STATE.slideshow.totalItems = itemIds.length;

View File

@@ -9,12 +9,12 @@
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png", "imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
"versions": [ "versions": [
{ {
"version": "1.5.0.1", "version": "1.5.0.21",
"changelog": "- fix: keyboard controls in TV mode \n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo", "changelog": "- fix: Keyboard controls in TV mode\n- Add sorting options for content\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo",
"targetAbi": "10.11.0.0", "targetAbi": "10.11.0.0",
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.1/Jellyfin.Plugin.MediaBarEnhanced.zip", "sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.21/Jellyfin.Plugin.MediaBarEnhanced.zip",
"checksum": "86e112b2d3ba95943c94fcde221e200c", "checksum": "9a28102dbd4b62abdc8ef72abd7c6574",
"timestamp": "2026-02-08T00:00:00Z" "timestamp": "2026-02-09T22:29:09Z"
}, },
{ {
"version": "1.3.0.3", "version": "1.3.0.3",

View File

@@ -0,0 +1,32 @@
(async () => {
const apiClient = window.ApiClient;
if (!apiClient) { console.error("Logged in?"); return; }
try {
// Fetch 1 random item ID
const rnd = await apiClient.getItems(apiClient.getCurrentUserId(), { SortBy: "Random", Limit: 1, Recursive: true, IncludeItemTypes: "Movie,Series" });
if (rnd.Items.length > 0) {
const id = rnd.Items[0].Id;
console.log("Random Item ID:", id);
// Fetch Default Details
const defd = await apiClient.getItem(apiClient.getCurrentUserId(), id);
console.log("Default Fields:", defd);
// Fetch ALL Known Fields manually
const allFields = "Chapters,People,MediaStreams,UserData,RecursiveItemCount,DateCreated,MediaSources,ProductionYear,Studios,Genres,Tags,RemoteTrailers,ProviderIds,Overview,CommunityRating,CriticRating,OfficialRating,PremiereDate,RunTimeTicks";
const full = await res.json();
console.log("Full Details:", full);
// Helper to download JSON
const blob = new Blob([JSON.stringify(full, null, 2)], { type: "application/json" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `jellyfin-item-${id}.json`;
a.click();
URL.revokeObjectURL(url);
console.log("Downloaded JSON file.");
} else { console.warn("No items."); }
} catch (e) { console.error(e); }
})();

View File

@@ -0,0 +1,32 @@
(async () => {
// 1. Get Auth Data from the active client
const apiClient = window.ApiClient;
if (!apiClient) {
console.error("ApiClient not found. Are you logged in?");
return;
}
try {
console.log("Fetching random item...");
// 2. Fetch 1 random item
// const result = await apiClient.getItems(apiClient.getCurrentUserId(), { SortBy: "Random", Limit: 1, Recursive: true, IncludeItemTypes: "Movie,Series" });
const result = await apiClient.getItems(apiClient.getCurrentUserId(), {
SortBy: "Random",
Limit: 1,
Recursive: true,
IncludeItemTypes: "Movie,Series", // Optional: filter types
Fields: "Overview,RemoteTrailers,Genres,CommunityRating,CriticRating,OfficialRating,PremiereDate,RunTimeTicks,ProductionYear,MediaSources" // Request ALL fields
});
if (result.Items.length > 0) {
const item = result.Items[0];
console.log("Random Item Found:", item.Name);
console.dir(item); // Prints the full interactive object
} else {
console.warn("No items found.");
}
} catch (error) {
console.error("Error fetching item:", error);
}
})();

View File

@@ -0,0 +1,28 @@
(async () => {
const apiClient = window.ApiClient;
if (!apiClient) {
console.error("ApiClient nicht gefunden.");
return;
}
// Die ID des Items, das du abrufen möchtest
const itemId = "DEINE_ITEM_ID_HIER";
const userId = apiClient.getCurrentUserId();
try {
console.log(`Rufe Details für Item ${itemId} ab...`);
// Nutze getItem() statt getItems()
// Parameter: userId, itemId
const item = await apiClient.getItem(userId, itemId);
if (item) {
console.log("Item Details gefunden:", item.Name);
console.dir(item); // Zeigt alle Metadaten (Genres, Pfade, ProviderIds, etc.)
} else {
console.warn("Item konnte nicht gefunden werden.");
}
} catch (error) {
console.error("Fehler beim Abrufen des Items:", error);
}
})();