Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92fc8d72f7 | ||
|
|
cfe9dec550 | ||
|
|
1bef573aaf | ||
|
|
29a365b690 | ||
|
|
0ee0a65309 | ||
|
|
152d22b709 | ||
|
|
216dddad94 | ||
|
|
a6de148ca1 | ||
|
|
1f9378d74d | ||
|
|
cc025779dc | ||
|
|
3d10fd59b5 | ||
|
|
bf261eba96 | ||
|
|
e3116c30cf | ||
|
|
bb39c91d32 | ||
|
|
4e0c74614a | ||
|
|
b61bf92437 | ||
|
|
dfbd6ce964 | ||
|
|
f1cbcad177 | ||
|
|
feedd5d95f | ||
|
|
87d82cca15 | ||
|
|
a70746e095 | ||
|
|
f32283e0bf | ||
|
|
8f3985f307 | ||
|
|
0b2817ecff | ||
|
|
84faee2db4 | ||
|
|
3efa07ec51 | ||
|
|
af603e8803 | ||
|
|
fe63414e4b | ||
|
|
614c86083f | ||
|
|
17b9e8921e | ||
|
|
5075226ba8 | ||
|
|
443fb1008b | ||
|
|
8f12140aad | ||
|
|
1469712bb5 | ||
|
|
76ff03ac17 | ||
|
|
25b1ba5f2b | ||
|
|
eed3ca1860 | ||
|
|
0f14577f5d | ||
|
|
9999d6a633 | ||
|
|
a935fd7d5d | ||
|
|
60293e81e1 | ||
|
|
f54e55fe04 | ||
|
|
b3c42e2100 | ||
|
|
20ddbb32c7 | ||
|
|
14a5075e22 | ||
|
|
accb316a81 | ||
|
|
51c5cdf5bf | ||
|
|
306eff757b | ||
|
|
b8f28a5735 | ||
|
|
0932d9611d | ||
|
|
5e616db0ae | ||
|
|
538b0f2110 | ||
|
|
e717c07c54 | ||
|
|
0fa2d01ca3 | ||
|
|
5299b2a9d5 | ||
|
|
4f244988b9 | ||
|
|
5635a8f05e | ||
|
|
c901da4b0c | ||
|
|
c45cd0281f | ||
|
|
0c3e74829a | ||
|
|
e6b769f099 | ||
|
|
77371f7b98 | ||
|
|
988b800b6d | ||
|
|
4c6514ba9f | ||
|
|
6910eba7d6 | ||
|
|
3585b47b6c | ||
|
|
8170abdc94 | ||
|
|
535c0e17bf | ||
|
|
df1cee0eeb | ||
|
|
16cc56030f | ||
|
|
13ecbac96e | ||
|
|
8bca6f9052 | ||
|
|
217db2a66d | ||
|
|
5fd7bcb8b6 | ||
|
|
0b0e41a9f9 | ||
|
|
370db55714 | ||
|
|
e5d4800ef1 | ||
|
|
b910e92364 | ||
|
|
82283b1faf | ||
|
|
1588b1a6b2 | ||
|
|
de19466341 | ||
|
|
15054e314c | ||
|
|
3877f96b09 | ||
|
|
abca7cb3b6 | ||
|
|
998a0cfc68 | ||
|
|
63be8214d0 | ||
|
|
99411afffd | ||
|
|
9510ae6ba7 | ||
|
|
2030538acc | ||
|
|
463e9ef424 | ||
|
|
dbe9ce97d2 | ||
|
|
45c780c018 | ||
|
|
9de268caa7 | ||
|
|
a8298461f9 | ||
|
|
aa369e5c7b | ||
|
|
f62dc853be | ||
|
|
d0a7f5da8c | ||
|
|
1f140fd3c1 |
@@ -21,6 +21,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Configuration
|
||||
public bool SlideAnimationEnabled { get; set; } = true;
|
||||
public bool EnableVideoBackdrop { get; set; } = true;
|
||||
public bool UseSponsorBlock { get; set; } = true;
|
||||
public bool PreferLocalTrailers { get; set; } = false;
|
||||
public bool WaitForTrailerToEnd { get; set; } = true;
|
||||
public bool StartMuted { 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 IsEnabled { get; set; } = true;
|
||||
public bool EnableClientSideSettings { get; set; } = false;
|
||||
public string SortBy { get; set; } = "Random";
|
||||
public string SortOrder { get; set; } = "Ascending";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,14 @@
|
||||
<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>
|
||||
</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">
|
||||
<label>
|
||||
<input is="emby-checkbox" type="checkbox" id="WaitForTrailerToEnd"
|
||||
@@ -115,9 +123,15 @@
|
||||
<div class="fieldDescription" id="customMediaIdsDesc">Enter the IDs of the items you want to show in the slideshow.
|
||||
You can separate them by new line or comma.
|
||||
<br><br>
|
||||
<b>Manual Trailer Override:</b> You can specify a YouTube URL for an item by adding it in
|
||||
brackets: <br> <code>e.g. ID DESCRIPTION [https://youtu.be/...]</code> or <code>ID [https://youtu.be/...] DESCRIPTION</code>
|
||||
<br><br>
|
||||
<b>Manual Trailer/Video Override:</b> You can specify a YouTube URL <b>OR</b> a Jellyfin Item ID (e.g. for a Theme Video) for an item by adding it in
|
||||
brackets: <br> <code>e.g. ID DESCRIPTION [https://youtu.be/...]</code> or <code>ID [Method] DESCRIPTION</code>.
|
||||
<br>
|
||||
Methods:
|
||||
<ul>
|
||||
<li><b>YouTube URL:</b> Play a remote trailer from YouTube.</li>
|
||||
<li><b>Jellyfin Item ID (GUID):</b> Play the video of another library item (e.g. a Theme Video or Backdrop Video) using the native player.</li>
|
||||
</ul>
|
||||
<br>
|
||||
You can also add a description after the ID using any separator like space, pipe
|
||||
(|) or dash (-): <br>e.g. <code>ID DESCRIPTION</code> or <code>ID | DESCRIPTION</code>
|
||||
<br><br>
|
||||
@@ -174,8 +188,7 @@
|
||||
</div>
|
||||
<div class="selectContainer">
|
||||
<label class="selectLabel" for="PreferredVideoQuality">Preferred YouTube Quality</label>
|
||||
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality"
|
||||
class="emby-select-withcolor emby-select">
|
||||
<select is="emby-select" id="PreferredVideoQuality" name="PreferredVideoQuality" class="selectLayout emby-select-withcolor emby-select">
|
||||
<option value="Auto">Auto (Smart)</option>
|
||||
<option value="Maximum">Maximum (4K+)</option>
|
||||
<option value="1080p">1080p</option>
|
||||
@@ -274,6 +287,33 @@
|
||||
mobile).</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="selectLayout 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="selectLayout 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>
|
||||
<p>Leave a setting blank to use the default value.</p>
|
||||
<div class="inputContainer">
|
||||
@@ -297,7 +337,7 @@
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="PreloadCount">Preload Count</label>
|
||||
<input is="emby-input" type="number" id="PreloadCount" name="PreloadCount" />
|
||||
<div class="fieldDescription">Number of images to preload.</div>
|
||||
<div class="fieldDescription">Number of slides to preload.</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="MaxPaginationDots">Max Pagination
|
||||
@@ -370,7 +410,8 @@
|
||||
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
|
||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||
'EnableSeasonalContent', 'EnableClientSideSettings'
|
||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||
'PreferLocalTrailers'
|
||||
];
|
||||
|
||||
keys.forEach(function (key) {
|
||||
@@ -404,6 +445,23 @@
|
||||
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();
|
||||
});
|
||||
},
|
||||
@@ -419,7 +477,8 @@
|
||||
'WaitForTrailerToEnd', 'StartMuted', 'FullWidthVideo', 'EnableMobileVideo',
|
||||
'ShowTrailerButton', 'AlwaysShowArrows', 'EnableKeyboardControls',
|
||||
'EnableCustomMediaIds', 'CustomMediaIds', 'EnableLoadingScreen',
|
||||
'EnableSeasonalContent', 'EnableClientSideSettings'
|
||||
'EnableSeasonalContent', 'EnableClientSideSettings', 'SortBy', 'SortOrder',
|
||||
'PreferLocalTrailers'
|
||||
];
|
||||
|
||||
keys.forEach(function (key) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||
<Title>Jellyfin Media Bar Enhanced Plugin</Title>
|
||||
<Authors>CodeDevMLH</Authors>
|
||||
<Version>1.5.0.1</Version>
|
||||
<Version>1.6.1.2</Version>
|
||||
<RepositoryUrl>https://github.com/CodeDevMLH/jellyfin-plugin-media-bar-enhanced</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Jellyfin Slideshow by M0RPH3US v3.0.9
|
||||
* Modified by CodeDevMLH v1.1.0.0
|
||||
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||
* Modified by CodeDevMLH
|
||||
*
|
||||
* New features:
|
||||
* - optional Trailer background video support
|
||||
@@ -14,6 +14,9 @@
|
||||
* - option to disable loading screen
|
||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
||||
* - option to enable client-side settings (allow users to override settings locally on their device)
|
||||
* - option to enable seasonal content (only show items that are relevant to the current season/holiday)
|
||||
* - option to prefer local trailers (from the media item) over online sources
|
||||
* - options to sort the content by various criteria (PremiereDate, ProductionYear, Random, Original order, etc.)
|
||||
*/
|
||||
|
||||
@import url(https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400..700;1,400..700&display=swap);
|
||||
@@ -991,4 +994,15 @@
|
||||
|
||||
.dots-container .slide-counter {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.layout-tv .video-backdrop {
|
||||
mask-image: linear-gradient(to top,
|
||||
#fff0 2%,
|
||||
rgb(0 0 0 / 0.5) 6%,
|
||||
#000000 8%);
|
||||
-webkit-mask-image: linear-gradient(to top,
|
||||
#fff0 2%,
|
||||
rgb(0 0 0 / 0.5) 6%,
|
||||
#000000 8%);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Jellyfin Slideshow by M0RPH3US v4.0.1
|
||||
* Modified by CodeDevMLH v1.1.0.0
|
||||
* Modified by CodeDevMLH
|
||||
*
|
||||
* New features:
|
||||
* - optional Trailer background video support
|
||||
@@ -14,6 +14,9 @@
|
||||
* - option to disable loading screen
|
||||
* - option to put collection (boxsets) IDs into the slideshow to display their items
|
||||
* - option to enable client-side settings (allow users to override settings locally on their device)
|
||||
* - option to enable seasonal content (only show items that are relevant to the current season/holiday)
|
||||
* - option to prefer local trailers (from the media item) over online sources
|
||||
* - options to sort the content by various criteria (PremiereDate, ProductionYear, Random, Original order, etc.)
|
||||
*/
|
||||
|
||||
//Core Module Configuration
|
||||
@@ -38,6 +41,7 @@ const CONFIG = {
|
||||
slideAnimationEnabled: true,
|
||||
enableVideoBackdrop: true,
|
||||
useSponsorBlock: true,
|
||||
preferLocalTrailers: false,
|
||||
waitForTrailerToEnd: true,
|
||||
startMuted: true,
|
||||
fullWidthVideo: true,
|
||||
@@ -51,6 +55,8 @@ const CONFIG = {
|
||||
customMediaIds: "",
|
||||
enableLoadingScreen: true,
|
||||
enableClientSideSettings: false,
|
||||
sortBy: "Random",
|
||||
sortOrder: "Ascending",
|
||||
};
|
||||
|
||||
// State management
|
||||
@@ -82,6 +88,7 @@ const STATE = {
|
||||
isMuted: CONFIG.startMuted,
|
||||
customTrailerUrls: {},
|
||||
ytPromise: null,
|
||||
autoplayTimeouts: [],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -460,6 +467,66 @@ waitForApiClientAndInitialize();
|
||||
* Utility functions for slide creation and management
|
||||
*/
|
||||
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
|
||||
* @param {Array} array - Array to shuffle
|
||||
@@ -542,7 +609,10 @@ const SlideUtils = {
|
||||
getOrCreateSlidesContainer() {
|
||||
let container = document.getElementById("slides-container");
|
||||
if (!container) {
|
||||
container = this.createElement("div", { id: "slides-container" });
|
||||
container = this.createElement("div", {
|
||||
id: "slides-container",
|
||||
className: "noautofocus"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
@@ -670,7 +740,11 @@ const SlideUtils = {
|
||||
autoplay: 1,
|
||||
controls: 1,
|
||||
iv_load_policy: 3,
|
||||
rel: 0
|
||||
rel: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin,
|
||||
widget_referrer: window.location.href,
|
||||
enablejsapi: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -960,8 +1034,8 @@ const ApiUtils = {
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
`${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}`,
|
||||
`${STATE.jellyfinData.serverAddress}/Items/${itemId}?Fields=Overview,RemoteTrailers,Genres,CommunityRating,CriticRating,OfficialRating,PremiereDate,ProductionYear,MediaSources,RunTimeTicks,LocalTrailerCount`,
|
||||
{
|
||||
headers: this.getAuthHeaders(),
|
||||
}
|
||||
@@ -1033,8 +1107,16 @@ const ApiUtils = {
|
||||
|
||||
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(
|
||||
`${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(),
|
||||
}
|
||||
@@ -1253,6 +1335,42 @@ const ApiUtils = {
|
||||
console.error(`Error fetching collection items for ${collectionId}:`, error);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetches the first local trailer for an item
|
||||
* @param {string} itemId - Item ID
|
||||
* @returns {Promise<Object|null>} Trailer data object {id, 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;
|
||||
|
||||
// Return object with ID and URL
|
||||
return {
|
||||
id: trailer.Id,
|
||||
url: `${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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1309,6 +1427,24 @@ class SlideTimer {
|
||||
*/
|
||||
const VisibilityObserver = {
|
||||
updateVisibility() {
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
// If a full screen video player is active, hide slideshow and stop playback
|
||||
if ((videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'))) {
|
||||
const container = document.getElementById("slides-container");
|
||||
if (container) {
|
||||
container.style.display = "none";
|
||||
container.style.visibility = "hidden";
|
||||
container.style.pointerEvents = "none";
|
||||
}
|
||||
if (STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
}
|
||||
SlideshowManager.stopAllPlayback();
|
||||
return;
|
||||
}
|
||||
|
||||
const activeTab = document.querySelector(".emby-tab-button-active");
|
||||
const container = document.getElementById("slides-container");
|
||||
|
||||
@@ -1435,12 +1571,37 @@ const SlideCreator = {
|
||||
let isVideo = false;
|
||||
let trailerUrl = null;
|
||||
|
||||
// 1. Check for Remote Trailers (YouTube)
|
||||
// Priority: Custom Config URL > Metadata RemoteTrailer
|
||||
// 1. Check for Remote/Local Trailers
|
||||
// Priority: Custom Config URL > (PreferLocal -> Local) > Metadata RemoteTrailer
|
||||
|
||||
// 1a. Custom URL override
|
||||
if (STATE.slideshow.customTrailerUrls && STATE.slideshow.customTrailerUrls[itemId]) {
|
||||
trailerUrl = STATE.slideshow.customTrailerUrls[itemId];
|
||||
console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`);
|
||||
} else if (item.RemoteTrailers && item.RemoteTrailers.length > 0) {
|
||||
const customValue = STATE.slideshow.customTrailerUrls[itemId];
|
||||
|
||||
// Check if the custom value is a Jellyfin Item ID (GUID)
|
||||
const guidMatch = customValue.match(/^([0-9a-f]{32})$/i);
|
||||
|
||||
if (guidMatch) {
|
||||
const videoId = guidMatch[1];
|
||||
console.log(`Using custom local video ID for ${itemId}: ${videoId}`);
|
||||
|
||||
trailerUrl = {
|
||||
id: videoId,
|
||||
url: `${STATE.jellyfinData.serverAddress}/Videos/${videoId}/stream.mp4?Static=true&api_key=${STATE.jellyfinData.accessToken}`
|
||||
};
|
||||
} else {
|
||||
// Assume it's a standard URL (YouTube, etc.)
|
||||
trailerUrl = customValue;
|
||||
console.log(`Using custom trailer URL for ${itemId}: ${trailerUrl}`);
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -1457,12 +1618,17 @@ const SlideCreator = {
|
||||
let videoId = null;
|
||||
|
||||
try {
|
||||
const urlObj = new URL(trailerUrl);
|
||||
if (urlObj.hostname.includes('youtube.com') || urlObj.hostname.includes('youtu.be')) {
|
||||
let urlToCheck = trailerUrl;
|
||||
if (typeof trailerUrl === 'object' && trailerUrl.url) {
|
||||
urlToCheck = trailerUrl.url;
|
||||
}
|
||||
|
||||
const urlObjChecked = new URL(urlToCheck);
|
||||
if (urlObjChecked.hostname.includes('youtube.com') || urlObjChecked.hostname.includes('youtu.be')) {
|
||||
isYoutube = true;
|
||||
videoId = urlObj.searchParams.get('v');
|
||||
if (!videoId && urlObj.hostname.includes('youtu.be')) {
|
||||
videoId = urlObj.pathname.substring(1);
|
||||
videoId = urlObjChecked.searchParams.get('v');
|
||||
if (!videoId && urlObjChecked.hostname.includes('youtu.be')) {
|
||||
videoId = urlObjChecked.pathname.substring(1);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1491,7 +1657,11 @@ const SlideCreator = {
|
||||
fs: 0,
|
||||
iv_load_policy: 3,
|
||||
rel: 0,
|
||||
loop: 0
|
||||
loop: 0,
|
||||
playsinline: 1,
|
||||
origin: window.location.origin,
|
||||
widget_referrer: window.location.href,
|
||||
enablejsapi: 1
|
||||
};
|
||||
|
||||
// Determine video quality
|
||||
@@ -1542,12 +1712,32 @@ const SlideCreator = {
|
||||
event.target.setPlaybackQuality(quality);
|
||||
}
|
||||
|
||||
// Only play if this is the active slide
|
||||
// Only play if this is the active slide AND the slideshow is visible
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
if (slide && slide.classList.contains('active')) {
|
||||
const isVideoPlayerOpen = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
if (slide && slide.classList.contains('active') && !document.hidden && (!isVideoPlayerOpen || isVideoPlayerOpen.classList.contains('hide'))) {
|
||||
const currentIndex = STATE.slideshow.currentSlideIndex;
|
||||
const currentItemId = STATE.slideshow.itemIds[currentIndex];
|
||||
if (currentItemId !== itemId) {
|
||||
console.log(`Slide ${itemId} is no longer active (current: ${currentItemId}), aborting playback.`);
|
||||
event.target.mute(); // Mute just in case
|
||||
return;
|
||||
}
|
||||
event.target.playVideo();
|
||||
|
||||
// Check if it actually started playing after a short delay (handling autoplay blocks)
|
||||
setTimeout(() => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
// Re-check conditions before processing fallback
|
||||
const isVideoPlayerOpenNow = document.querySelector('.videoPlayerContainer') || document.querySelector('.youtubePlayerContainer');
|
||||
if (document.hidden || (isVideoPlayerOpenNow && !isVideoPlayerOpenNow.classList.contains('hide')) || !slide.classList.contains('active')) {
|
||||
console.log(`Navigation detected during autoplay check for ${itemId}, stopping video.`);
|
||||
try {
|
||||
event.target.stopVideo();
|
||||
} catch (e) { console.warn("Error stopping video in timeout:", e); }
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.getPlayerState() !== YT.PlayerState.PLAYING &&
|
||||
event.target.getPlayerState() !== YT.PlayerState.BUFFERING) {
|
||||
console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`);
|
||||
@@ -1556,6 +1746,9 @@ const SlideCreator = {
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
if (!STATE.slideshow.autoplayTimeouts) STATE.slideshow.autoplayTimeouts = [];
|
||||
STATE.slideshow.autoplayTimeouts.push(timeoutId);
|
||||
|
||||
// Pause slideshow timer when video starts if configured
|
||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
@@ -1588,11 +1781,11 @@ const SlideCreator = {
|
||||
|
||||
const videoAttributes = {
|
||||
className: "backdrop video-backdrop",
|
||||
src: trailerUrl,
|
||||
src: (typeof trailerUrl === 'object' ? trailerUrl.url : trailerUrl),
|
||||
autoplay: false,
|
||||
preload: "auto",
|
||||
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) {
|
||||
@@ -1607,7 +1800,18 @@ const SlideCreator = {
|
||||
|
||||
STATE.slideshow.videoPlayers[itemId] = backdrop;
|
||||
|
||||
backdrop.addEventListener('play', () => {
|
||||
backdrop.addEventListener('play', (event) => {
|
||||
const slide = document.querySelector(`.slide[data-item-id="${itemId}"]`);
|
||||
const currentIndex = STATE.slideshow.currentSlideIndex;
|
||||
const currentItemId = STATE.slideshow.itemIds[currentIndex];
|
||||
|
||||
if (!slide || !slide.classList.contains('active') || currentItemId !== itemId) {
|
||||
console.log(`Local video ${itemId} started playing but is not active, pausing.`);
|
||||
event.target.pause();
|
||||
event.target.currentTime = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (CONFIG.waitForTrailerToEnd && STATE.slideshow.slideInterval) {
|
||||
STATE.slideshow.slideInterval.stop();
|
||||
}
|
||||
@@ -1879,11 +2083,20 @@ const SlideCreator = {
|
||||
|
||||
/**
|
||||
* Creates a trailer button
|
||||
* @param {string} url - Trailer URL
|
||||
* @param {string|Object} trailerInfo - Trailer URL string or object {id, url}
|
||||
* @returns {HTMLElement} Trailer button element
|
||||
*/
|
||||
createTrailerButton(url) {
|
||||
createTrailerButton(trailerInfo) {
|
||||
const trailerText = LocalizationUtils.getLocalizedString('Trailer', 'Trailer');
|
||||
|
||||
let url = trailerInfo;
|
||||
let localTrailerId = null;
|
||||
|
||||
if (typeof trailerInfo === 'object' && trailerInfo !== null) {
|
||||
url = trailerInfo.url;
|
||||
localTrailerId = trailerInfo.id;
|
||||
}
|
||||
|
||||
return SlideUtils.createElement("button", {
|
||||
className: "detailButton trailer-button",
|
||||
innerHTML: `<span class="material-icons">movie</span> <span class="trailer-text">${trailerText}</span>`,
|
||||
@@ -1891,7 +2104,13 @@ const SlideCreator = {
|
||||
onclick: (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
SlideUtils.openVideoModal(url);
|
||||
|
||||
if (localTrailerId) {
|
||||
// Play local trailer using native player
|
||||
ApiUtils.playItem(localTrailerId);
|
||||
} else {
|
||||
SlideUtils.openVideoModal(url);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -1934,6 +2153,11 @@ const SlideCreator = {
|
||||
|
||||
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(
|
||||
item,
|
||||
item.Type === "Movie" ? "Movie" : "TV Show"
|
||||
@@ -2031,6 +2255,16 @@ const SlideshowManager = {
|
||||
let previousVisibleSlide;
|
||||
try {
|
||||
const container = SlideUtils.getOrCreateSlidesContainer();
|
||||
|
||||
const activeElement = document.activeElement;
|
||||
let focusSelector = null;
|
||||
if (container.contains(activeElement)) {
|
||||
if (activeElement.classList.contains('play-button')) focusSelector = '.play-button';
|
||||
else if (activeElement.classList.contains('detail-button')) focusSelector = '.detail-button';
|
||||
else if (activeElement.classList.contains('favorite-button')) focusSelector = '.favorite-button';
|
||||
else if (activeElement.classList.contains('trailer-button')) focusSelector = '.trailer-button';
|
||||
}
|
||||
|
||||
const totalItems = STATE.slideshow.totalItems;
|
||||
|
||||
index = Math.max(0, Math.min(index, totalItems - 1));
|
||||
@@ -2058,6 +2292,15 @@ const SlideshowManager = {
|
||||
}
|
||||
|
||||
currentSlide.classList.add("active");
|
||||
|
||||
if (focusSelector) {
|
||||
const target = currentSlide.querySelector(focusSelector);
|
||||
if (target) {
|
||||
requestAnimationFrame(() => {
|
||||
target.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Manage Video Playback: Stop others, Play current
|
||||
|
||||
@@ -2066,8 +2309,14 @@ const SlideshowManager = {
|
||||
Object.keys(STATE.slideshow.videoPlayers).forEach(id => {
|
||||
if (id !== currentItemId) {
|
||||
const p = STATE.slideshow.videoPlayers[id];
|
||||
if (p && typeof p.pauseVideo === 'function') {
|
||||
p.pauseVideo();
|
||||
if (p) {
|
||||
try {
|
||||
if (typeof p.pauseVideo === 'function') {
|
||||
p.pauseVideo();
|
||||
} else if (p.tagName === 'VIDEO') {
|
||||
p.pause();
|
||||
}
|
||||
} catch (e) { console.warn("Error pausing player", id, e); }
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2075,8 +2324,11 @@ const SlideshowManager = {
|
||||
|
||||
// 2. Pause all other HTML5 videos e.g. local trailers
|
||||
document.querySelectorAll('video').forEach(video => {
|
||||
if (!video.closest(`.slide[data-item-id="${currentItemId}"]`)) {
|
||||
video.pause();
|
||||
const slideParent = video.closest('.slide');
|
||||
if (slideParent && slideParent.dataset.itemId !== currentItemId) {
|
||||
try {
|
||||
video.pause();
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2235,18 +2487,20 @@ const SlideshowManager = {
|
||||
*/
|
||||
async preloadAdjacentSlides(currentIndex) {
|
||||
const totalItems = STATE.slideshow.totalItems;
|
||||
const preloadCount = CONFIG.preloadCount;
|
||||
const preloadCount = Math.min(Math.max(CONFIG.preloadCount || 1, 1), 5);
|
||||
|
||||
const nextIndex = (currentIndex + 1) % totalItems;
|
||||
const itemId = STATE.slideshow.itemIds[nextIndex];
|
||||
// Preload next slides
|
||||
for (let i = 1; i <= preloadCount; i++) {
|
||||
const nextIndex = (currentIndex + i) % totalItems;
|
||||
const itemId = STATE.slideshow.itemIds[nextIndex];
|
||||
SlideCreator.createSlideForItemId(itemId);
|
||||
}
|
||||
|
||||
await SlideCreator.createSlideForItemId(itemId);
|
||||
|
||||
if (preloadCount > 1) {
|
||||
const prevIndex = (currentIndex - 1 + totalItems) % totalItems;
|
||||
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
||||
|
||||
SlideCreator.createSlideForItemId(prevItemId);
|
||||
// Preload previous slides
|
||||
for (let i = 1; i <= preloadCount; i++) {
|
||||
const prevIndex = (currentIndex - i + totalItems) % totalItems;
|
||||
const prevItemId = STATE.slideshow.itemIds[prevIndex];
|
||||
SlideCreator.createSlideForItemId(prevItemId);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2280,7 +2534,14 @@ const SlideshowManager = {
|
||||
const index = STATE.slideshow.itemIds.indexOf(itemId);
|
||||
if (index === -1) return;
|
||||
|
||||
const distance = Math.abs(index - currentIndex);
|
||||
const totalItems = STATE.slideshow.itemIds.length;
|
||||
|
||||
// Calculate wrapped distance
|
||||
let distance = Math.abs(index - currentIndex);
|
||||
if (totalItems > keepRange * 2) {
|
||||
distance = Math.min(distance, totalItems - distance);
|
||||
}
|
||||
|
||||
if (distance > keepRange) {
|
||||
// Destroy video player if exists
|
||||
if (STATE.slideshow.videoPlayers[itemId]) {
|
||||
@@ -2426,15 +2687,26 @@ const SlideshowManager = {
|
||||
* Used when navigating away from the home screen
|
||||
*/
|
||||
stopAllPlayback() {
|
||||
// 1. Pause all YouTube players
|
||||
// Clear any pending autoplay timeouts
|
||||
if (STATE.slideshow.autoplayTimeouts) {
|
||||
STATE.slideshow.autoplayTimeouts.forEach(id => clearTimeout(id));
|
||||
STATE.slideshow.autoplayTimeouts = [];
|
||||
}
|
||||
|
||||
// 1. Stop all YouTube players
|
||||
if (STATE.slideshow.videoPlayers) {
|
||||
Object.values(STATE.slideshow.videoPlayers).forEach(player => {
|
||||
try {
|
||||
if (player && typeof player.pauseVideo === 'function') {
|
||||
if (player && typeof player.stopVideo === 'function') {
|
||||
player.stopVideo();
|
||||
if (typeof player.clearVideo === 'function') {
|
||||
player.clearVideo();
|
||||
}
|
||||
} else if (player && typeof player.pauseVideo === 'function') {
|
||||
player.pauseVideo();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error pausing YouTube player:", e);
|
||||
console.warn("Error pausing/stopping YouTube player:", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2533,58 +2805,80 @@ const SlideshowManager = {
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
const container = document.getElementById("slides-container");
|
||||
// Allow interaction if container is visible, even if not strictly focused
|
||||
if (!container || container.style.display === "none") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only trap keys if focus is on body (neutral) or inside our container.
|
||||
// To allow standard TV navigation to work for other elements (e.g. library cards).
|
||||
const activeEl = document.activeElement;
|
||||
const isBody = activeEl === document.body || !activeEl;
|
||||
const isInContainer = container.contains(activeEl) || activeEl === container;
|
||||
const activeElement = document.activeElement;
|
||||
const isTvDevice = window.browser && window.browser.tv;
|
||||
const isTvLayout = window.layoutManager && window.layoutManager.tv;
|
||||
const hasTvClass = document.documentElement.classList.contains('layout-tv') || document.body.classList.contains('layout-tv');
|
||||
const isTvMode = isTvDevice || isTvLayout || hasTvClass;
|
||||
|
||||
if (!isBody && !isInContainer) {
|
||||
return;
|
||||
}
|
||||
// Check Focus State
|
||||
const isBodyFocused = activeElement === document.body;
|
||||
const hasDirectFocus = container.contains(activeElement) || activeElement === container;
|
||||
|
||||
// Determine if we should handle navigation keys (Arrows, Space, M)
|
||||
// TV Mode: Strict focus required (must be on slideshow)
|
||||
// Desktop Mode: Loose focus allowed (slideshow OR body/nothing focused)
|
||||
const canControlSlideshow = isTvMode ? hasDirectFocus : (hasDirectFocus || isBodyFocused);
|
||||
|
||||
const focusElement = document.activeElement;
|
||||
// Check for Input Fields (always ignore typing)
|
||||
const isInputElement = activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable);
|
||||
if (isInputElement) return;
|
||||
|
||||
// Check active video players (ignore if video is playing/overlay is open)
|
||||
const videoPlayer = document.querySelector('.videoPlayerContainer');
|
||||
const trailerPlayer = document.querySelector('.youtubePlayerContainer');
|
||||
const isVideoOpen = (videoPlayer && !videoPlayer.classList.contains('hide')) || (trailerPlayer && !trailerPlayer.classList.contains('hide'));
|
||||
if (isVideoOpen) return;
|
||||
|
||||
switch (e.key) {
|
||||
case "ArrowRight":
|
||||
if (focusElement && focusElement.classList.contains("detail-button")) {
|
||||
focusElement.previousElementSibling.focus();
|
||||
} else {
|
||||
if (canControlSlideshow) {
|
||||
SlideshowManager.nextSlide();
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case "ArrowLeft":
|
||||
if (focusElement && focusElement.classList.contains("play-button")) {
|
||||
focusElement.nextElementSibling.focus();
|
||||
} else {
|
||||
if (canControlSlideshow) {
|
||||
SlideshowManager.prevSlide();
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case " ": // Space bar
|
||||
this.togglePause();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
this.togglePause();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case "m": // Mute toggle
|
||||
case "M":
|
||||
this.toggleMute();
|
||||
e.preventDefault();
|
||||
if (canControlSlideshow) {
|
||||
this.toggleMute();
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case "Enter":
|
||||
if (focusElement) {
|
||||
focusElement.click();
|
||||
// Enter always requires direct focus on the slideshow to avoid conflicts
|
||||
if (hasDirectFocus) {
|
||||
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;
|
||||
}
|
||||
});
|
||||
@@ -2776,10 +3070,28 @@ const SlideshowManager = {
|
||||
if (itemIds.length === 0) {
|
||||
console.log("No custom list found, fetching random items from server...");
|
||||
itemIds = await ApiUtils.fetchItemIdsFromServer();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
itemIds = SlideUtils.shuffleArray(itemIds);
|
||||
|
||||
STATE.slideshow.itemIds = itemIds;
|
||||
STATE.slideshow.totalItems = itemIds.length;
|
||||
|
||||
|
||||
@@ -9,12 +9,36 @@
|
||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/raw/branch/main/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.5.0.1",
|
||||
"changelog": "- fix: keyboard controls in TV mode \n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from original repo",
|
||||
"version": "1.6.1.2",
|
||||
"changelog": "- fix tv mode issue",
|
||||
"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",
|
||||
"checksum": "86e112b2d3ba95943c94fcde221e200c",
|
||||
"timestamp": "2026-02-08T00:00:00Z"
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.1.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "186c08c80091c24270fda41f0908e951",
|
||||
"timestamp": "2026-02-11T19:13:24Z"
|
||||
},
|
||||
{
|
||||
"version": "1.6.0.2",
|
||||
"changelog": "- add local trailer support on trailer button\nfix: iOS/MacOS playback issue?",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.6.0.2/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "cdd0208f8cc4f4b04f50e7138e508370",
|
||||
"timestamp": "2026-02-10T22:07:33Z"
|
||||
},
|
||||
{
|
||||
"version": "1.5.1.3",
|
||||
"changelog": "- fix: iOS/MacOS playback issue?",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.1.3/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "9d9dbed453673d4b78acf2adaaaee126",
|
||||
"timestamp": "2026-02-10T20:12:59Z"
|
||||
},
|
||||
{
|
||||
"version": "1.5.0.28",
|
||||
"changelog": "- fix: Keyboard controls in TV mode\n- Add sorting options for content\n- Add local trailer support\n- fix performance issue\n- Update mediaBarEnhanced.js and mediaBarEnhanced.css with version 4.0.1 from upstream repo",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.5.0.28/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||
"checksum": "0261ff27be18d48cefa5078706954240",
|
||||
"timestamp": "2026-02-10T00:35:41Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.0.3",
|
||||
|
||||
32
test_scripts/fetch_random_item_browser_console.js
Normal file
32
test_scripts/fetch_random_item_browser_console.js
Normal 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); }
|
||||
})();
|
||||
32
test_scripts/fetch_random_item_browser_console_2.js
Normal file
32
test_scripts/fetch_random_item_browser_console_2.js
Normal 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);
|
||||
}
|
||||
})();
|
||||
28
test_scripts/fetch_specific_items.js
Normal file
28
test_scripts/fetch_specific_items.js
Normal 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);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user