Compare commits
7 Commits
v1.7.2.8
...
3a61b3e548
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a61b3e548 | ||
|
|
950116a775 | ||
|
|
b9040c20fc | ||
|
|
8388463880 | ||
|
|
233e569c94 | ||
|
|
93c265ffed | ||
|
|
8f4dfa31c8 |
@@ -44,18 +44,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
|
|
||||||
var stream = assembly.GetManifestResourceStream(resourceName);
|
var stream = assembly.GetManifestResourceStream(resourceName);
|
||||||
|
|
||||||
// if (stream == null)
|
|
||||||
// {
|
|
||||||
// // Try fallback/debug matching
|
|
||||||
// var allNames = assembly.GetManifestResourceNames();
|
|
||||||
// var match = Array.Find(allNames, n => n.EndsWith(resourcePath, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
// if (match != null)
|
|
||||||
// {
|
|
||||||
// stream = assembly.GetManifestResourceStream(match);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (stream == null)
|
if (stream == null)
|
||||||
{
|
{
|
||||||
return NotFound($"Resource not found: {resourceName}");
|
return NotFound($"Resource not found: {resourceName}");
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
||||||
{
|
{
|
||||||
@@ -26,7 +27,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uploads a new custom overlay image.
|
/// Uploads a new custom overlay image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Microsoft.AspNetCore.Authorization.Authorize]
|
[Authorize(Policy = "RequiresElevation")]
|
||||||
[HttpPost("OverlayImage")]
|
[HttpPost("OverlayImage")]
|
||||||
[Consumes("multipart/form-data")]
|
[Consumes("multipart/form-data")]
|
||||||
public async Task<IActionResult> UploadImage([FromForm] IFormFile file, [FromQuery] string? filename = null)
|
public async Task<IActionResult> UploadImage([FromForm] IFormFile file, [FromQuery] string? filename = null)
|
||||||
@@ -40,7 +41,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
string extension = Path.GetExtension(file.FileName);
|
string extension = Path.GetExtension(file.FileName);
|
||||||
if (string.IsNullOrWhiteSpace(extension)) extension = ".jpg";
|
if (string.IsNullOrWhiteSpace(extension)) extension = ".jpg";
|
||||||
|
|
||||||
// Delete any existing file with this prefix before saving the new one (as extensions might differ)
|
// Delete any existing file with this prefix before saving the new one
|
||||||
string prefix = string.IsNullOrWhiteSpace(filename) ? "custom_overlay_image_global" : $"custom_overlay_image_{filename}";
|
string prefix = string.IsNullOrWhiteSpace(filename) ? "custom_overlay_image_global" : $"custom_overlay_image_{filename}";
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -60,9 +61,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
string targetFileName = $"{prefix}{extension}";
|
string targetFileName = $"{prefix}{extension}";
|
||||||
string targetPath = Path.Combine(_imageDirectory, targetFileName);
|
string targetPath = Path.Combine(_imageDirectory, targetFileName);
|
||||||
|
|
||||||
// Delete is not strictly necessary and can cause locking issues if someone is currently reading it.
|
|
||||||
// FileMode.Create will truncate the file if it exists, effectively overwriting it.
|
|
||||||
// We use FileShare.None to ensure we have exclusive write access, but handle potential IOExceptions gracefully.
|
|
||||||
using (var stream = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None))
|
using (var stream = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||||
{
|
{
|
||||||
await file.CopyToAsync(stream).ConfigureAwait(false);
|
await file.CopyToAsync(stream).ConfigureAwait(false);
|
||||||
@@ -82,7 +80,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the custom overlay image.
|
/// Retrieves the custom overlay image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Microsoft.AspNetCore.Authorization.Authorize]
|
|
||||||
[HttpGet("OverlayImage")]
|
[HttpGet("OverlayImage")]
|
||||||
public IActionResult GetImage([FromQuery] string? filename = null)
|
public IActionResult GetImage([FromQuery] string? filename = null)
|
||||||
{
|
{
|
||||||
@@ -98,7 +95,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
string targetPath = existingFiles[0];
|
string targetPath = existingFiles[0];
|
||||||
|
|
||||||
// Read the file and return with appropriate MIME type
|
// Read the file and return with appropriate MIME type
|
||||||
// We use FileShare.ReadWrite | FileShare.Delete so that if someone is currently overwriting the file (uploading), we don't block them.
|
|
||||||
var stream = new FileStream(targetPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
var stream = new FileStream(targetPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
||||||
|
|
||||||
string mimeType = "application/octet-stream";
|
string mimeType = "application/octet-stream";
|
||||||
@@ -115,7 +111,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes a custom overlay image.
|
/// Deletes a custom overlay image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Microsoft.AspNetCore.Authorization.Authorize]
|
[Authorize(Policy = "RequiresElevation")]
|
||||||
[HttpDelete("OverlayImage")]
|
[HttpDelete("OverlayImage")]
|
||||||
public IActionResult DeleteImage([FromQuery] string? filename = null)
|
public IActionResult DeleteImage([FromQuery] string? filename = null)
|
||||||
{
|
{
|
||||||
@@ -144,7 +140,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Renames a custom overlay image (used when a seasonal section is renamed).
|
/// Renames a custom overlay image (used when a seasonal section is renamed).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Microsoft.AspNetCore.Authorization.Authorize]
|
|
||||||
[HttpPut("OverlayImage/Rename")]
|
[HttpPut("OverlayImage/Rename")]
|
||||||
public IActionResult RenameImage([FromQuery] string oldName, [FromQuery] string newName)
|
public IActionResult RenameImage([FromQuery] string oldName, [FromQuery] string newName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -263,7 +263,7 @@
|
|||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="fieldDescription">Uploading an image will securely save it to the server and automatically update the URL field above.</div>
|
<div class="fieldDescription">Uploading an image will save it to your server and automatically update the URL field above.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="sectionTitle" style="margin-top: 1.2em;">Styles</h2>
|
<h2 class="sectionTitle" style="margin-top: 1.2em;">Styles</h2>
|
||||||
@@ -943,7 +943,7 @@
|
|||||||
MediaBarEnhancedConfigurationPage.createSectionElement(container, {
|
MediaBarEnhancedConfigurationPage.createSectionElement(container, {
|
||||||
Name: 'New Season',
|
Name: 'New Season',
|
||||||
StartDay: 1, StartMonth: 1,
|
StartDay: 1, StartMonth: 1,
|
||||||
EndDay: 1, EndMonth: 1,
|
EndDay: 31, EndMonth: 1,
|
||||||
MediaIds: '',
|
MediaIds: '',
|
||||||
OverlayText: '',
|
OverlayText: '',
|
||||||
OverlayImageUrl: ''
|
OverlayImageUrl: ''
|
||||||
@@ -1021,7 +1021,7 @@
|
|||||||
' </div>' +
|
' </div>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="inputContainer" style="flex: 1; min-width: 250px; margin: 0; padding-bottom: 5px;">' +
|
' <div class="inputContainer" style="flex: 1; min-width: 250px; margin: 0; padding-bottom: 5px;">' +
|
||||||
' <div class="seasonal-dropzone" style="border: 2px dashed rgba(255,255,255,0.2); border-radius: 8px; padding: 1em; text-align: center; cursor: pointer; background: rgba(0,0,0,0.2); transition: all 0.2s ease; position: relative; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center;">' +
|
' <div class="seasonal-dropzone" style="border: 2px dashed rgba(255,255,255,0.2); border-radius: 8px; padding: 1em; text-align: center; cursor: pointer; background: rgba(0,0,0,0.2); transition: all 0.2s ease; position: relative; min-height: 98px; display: flex; flex-direction: column; align-items: center; justify-content: center;">' +
|
||||||
' <i class="material-icons" style="font-size: 24px; color: rgba(255,255,255,0.4); margin-bottom: 4px;">cloud_upload</i>' +
|
' <i class="material-icons" style="font-size: 24px; color: rgba(255,255,255,0.4); margin-bottom: 4px;">cloud_upload</i>' +
|
||||||
' <span style="font-size: 0.85em; color: rgba(255,255,255,0.7);">Upload seasonal image</span>' +
|
' <span style="font-size: 0.85em; color: rgba(255,255,255,0.7);">Upload seasonal image</span>' +
|
||||||
' <input type="file" class="seasonal-file-input" accept="image/png, image/jpeg, image/gif, image/webp" style="display: none;">' +
|
' <input type="file" class="seasonal-file-input" accept="image/png, image/jpeg, image/gif, image/webp" style="display: none;">' +
|
||||||
|
|||||||
@@ -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.7.2.8</Version>
|
<Version>1.7.2.9</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>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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.7.2.8",
|
"version": "1.7.2.9",
|
||||||
"changelog": "feat: add custom text/image overlay option\n- feat: add option to disable pagination dots/counter\n- feat: add exclude seasonal content from random fetching option\n- Add hide arrows on mobile option \n- fix button issue on mobile when using ElegantFin Theme",
|
"changelog": "feat: add custom text/image overlay option\n- feat: add option to disable pagination dots/counter\n- feat: add exclude seasonal content from random fetching option\n- Add hide arrows on mobile option \n- fix button issue on mobile when using ElegantFin Theme",
|
||||||
"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.7.2.8/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.7.2.9/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "b2ddf7bd8f42d5bcddff03259115d086",
|
"checksum": "7e70de12804aba803fdbe060c9ca5ae0",
|
||||||
"timestamp": "2026-03-10T23:05:13Z"
|
"timestamp": "2026-03-10T23:38:06Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.7.0.14",
|
"version": "1.7.0.14",
|
||||||
|
|||||||
Reference in New Issue
Block a user