Compare commits
5 Commits
518fd5640e
...
v1.7.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22c873d686 | ||
|
|
c3a73cc28b | ||
|
|
fc3a5f1e66 | ||
|
|
cd490cf0f3 | ||
|
|
bb6310381a |
@@ -23,7 +23,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
_applicationPaths = applicationPaths;
|
_applicationPaths = applicationPaths;
|
||||||
|
|
||||||
// We use the plugin's data folder to store the image
|
// We use the plugin's data folder to store the image
|
||||||
_imageDirectory = Path.Combine(_applicationPaths.PluginConfigurationPath, "MediaBarEnhanced");
|
_imageDirectory = MediaBarEnhancedPlugin.Instance?.DataFolderPath ?? Path.Combine(applicationPaths.DataPath, "plugins", "MediaBarEnhanced");
|
||||||
|
|
||||||
// We'll just overwrite this single file each time
|
// We'll just overwrite this single file each time
|
||||||
_imagePath = Path.Combine(_imageDirectory, "custom_overlay_image.dat");
|
_imagePath = Path.Combine(_imageDirectory, "custom_overlay_image.dat");
|
||||||
@@ -48,13 +48,10 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
Directory.CreateDirectory(_imageDirectory);
|
Directory.CreateDirectory(_imageDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the old one if it exists to ensure freshness
|
// Delete is not strictly necessary and can cause locking issues if someone is currently reading it.
|
||||||
if (System.IO.File.Exists(_imagePath))
|
// 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.
|
||||||
System.IO.File.Delete(_imagePath);
|
using (var stream = new FileStream(_imagePath, FileMode.Create, FileAccess.Write, FileShare.None))
|
||||||
}
|
|
||||||
|
|
||||||
using (var stream = new FileStream(_imagePath, FileMode.Create))
|
|
||||||
{
|
{
|
||||||
await file.CopyToAsync(stream).ConfigureAwait(false);
|
await file.CopyToAsync(stream).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -80,9 +77,12 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Api
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the file and return as a generic octet stream, since we don't strictly track the mime type
|
// Read the file and return as a generic octet stream.
|
||||||
// The browser will figure out it's an image
|
// We use FileShare.ReadWrite so that if someone is currently overwriting the file (uploading), we don't block them,
|
||||||
var stream = new FileStream(_imagePath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
// and we also don't get blocked by other readers.
|
||||||
|
var stream = new FileStream(_imagePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
|
|
||||||
|
// "image/*" works reliably as browsers will sniff the exact image mime type (jpeg, png, webp).
|
||||||
return File(stream, "image/*");
|
return File(stream, "image/*");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,10 @@
|
|||||||
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
|
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
|
||||||
<h3>Advanced Settings</h3>
|
<h3>Advanced Settings</h3>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="jellyfin-tab-button" onclick="showTab('media-bar-enhanced-overlay', this)"
|
||||||
|
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
|
||||||
|
<h3>Custom Overlay</h3>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="mediaBarEnhancedConfigForm">
|
<form id="mediaBarEnhancedConfigForm">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Jellyfin.Plugin.MediaBarEnhanced.Helpers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Safety Check: If plugin is disabled, do nothing
|
// Safety Check: If plugin is disabled, do nothing
|
||||||
if (!MediaBarEnhancedPlugin.Instance.Configuration.IsEnabled)
|
if (MediaBarEnhancedPlugin.Instance?.Configuration?.IsEnabled != true)
|
||||||
{
|
{
|
||||||
return originalContents;
|
return originalContents;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.1.15</Version>
|
<Version>1.7.2.0</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>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ namespace Jellyfin.Plugin.MediaBarEnhanced
|
|||||||
{
|
{
|
||||||
private readonly ScriptInjector _scriptInjector;
|
private readonly ScriptInjector _scriptInjector;
|
||||||
private readonly ILoggerFactory _loggerFactory;
|
private readonly ILoggerFactory _loggerFactory;
|
||||||
public IServiceProvider ServiceProvider { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="MediaBarEnhancedPlugin"/> class.
|
/// Initializes a new instance of the <see cref="MediaBarEnhancedPlugin"/> class.
|
||||||
|
|||||||
@@ -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.1.15",
|
"version": "1.7.2.0",
|
||||||
"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.1.14/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/jellyfin-plugin-media-bar-enhanced/releases/download/v1.7.2.0/Jellyfin.Plugin.MediaBarEnhanced.zip",
|
||||||
"checksum": "d4a115b5e3fd192572e21be8e95c55a7",
|
"checksum": "6cb9c718f1ce097a31153a515f096040",
|
||||||
"timestamp": "2026-03-09T01:29:55Z"
|
"timestamp": "2026-03-09T03:12:08Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.7.0.14",
|
"version": "1.7.0.14",
|
||||||
|
|||||||
Reference in New Issue
Block a user