Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/commit/bc959270b762d1a6f68fc4f46a7c42138b39710c?style=unified&whitespace=ignore-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
9 changed files with
86 additions and
105 deletions
@ -1,4 +1,4 @@
using System ;
using System ;
using System.IO ;
using System.Xml ;
using System.Xml.Serialization ;
@ -59,22 +59,18 @@ public class MigrateMusicBrainzTimeout : IMigrationRoutine
private OldMusicBrainzConfiguration ? ReadOld ( string path )
{
using ( var xmlReader = XmlReader . Create ( path ) )
{
using var xmlReader = XmlReader . Create ( path ) ;
var serverConfigSerializer = new XmlSerializer ( typeof ( OldMusicBrainzConfiguration ) , new XmlRootAttribute ( "PluginConfiguration" ) ) ;
return serverConfigSerializer . Deserialize ( xmlReader ) as OldMusicBrainzConfiguration ;
}
}
private void WriteNew ( string path , PluginConfiguration newPluginConfiguration )
{
var pluginConfigurationSerializer = new XmlSerializer ( typeof ( PluginConfiguration ) , new XmlRootAttribute ( "PluginConfiguration" ) ) ;
var xmlWriterSettings = new XmlWriterSettings { Indent = true } ;
using ( var xmlWriter = XmlWriter . Create ( path , xmlWriterSettings ) )
{
using var xmlWriter = XmlWriter . Create ( path , xmlWriterSettings ) ;
pluginConfigurationSerializer . Serialize ( xmlWriter , newPluginConfiguration ) ;
}
}
#pragma warning disable
public sealed class OldMusicBrainzConfiguration
@ -43,11 +43,9 @@ public class MigrateNetworkConfiguration : IMigrationRoutine
try
{
using ( var xmlReader = XmlReader . Create ( path ) )
{
using var xmlReader = XmlReader . Create ( path ) ;
oldNetworkConfiguration = ( OldNetworkConfiguration ? ) oldNetworkConfigSerializer . Deserialize ( xmlReader ) ;
}
}
catch ( InvalidOperationException ex )
{
_logger . LogError ( ex , "Migrate NetworkConfiguration deserialize Invalid Operation error" ) ;
@ -97,12 +95,10 @@ public class MigrateNetworkConfiguration : IMigrationRoutine
var networkConfigSerializer = new XmlSerializer ( typeof ( NetworkConfiguration ) ) ;
var xmlWriterSettings = new XmlWriterSettings { Indent = true } ;
using ( var xmlWriter = XmlWriter . Create ( path , xmlWriterSettings ) )
{
using var xmlWriter = XmlWriter . Create ( path , xmlWriterSettings ) ;
networkConfigSerializer . Serialize ( xmlWriter , networkConfiguration ) ;
}
}
}
#pragma warning disable
public sealed class OldNetworkConfiguration
@ -489,11 +489,9 @@ public class SkiaEncoder : IImageEncoder
Directory . CreateDirectory ( directory ) ;
using ( var outputStream = new SKFileWStream ( outputPath ) )
{
using ( var pixmap = new SKPixmap ( new SKImageInfo ( width , height ) , saveBitmap . GetPixels ( ) ) )
{
using var pixmap = new SKPixmap ( new SKImageInfo ( width , height ) , saveBitmap . GetPixels ( ) ) ;
pixmap . Encode ( outputStream , skiaOutputFormat , quality ) ;
}
}
return outputPath ;
}
@ -111,11 +111,9 @@ public sealed class ImageProcessor : IImageProcessor, IDisposable
public async Task ProcessImage ( ImageProcessingOptions options , Stream toStream )
{
var file = await ProcessImage ( options ) . ConfigureAwait ( false ) ;
using ( var fileStream = AsyncFile . OpenRead ( file . Path ) )
{
using var fileStream = AsyncFile . OpenRead ( file . Path ) ;
await fileStream . CopyToAsync ( toStream ) . ConfigureAwait ( false ) ;
}
}
/// <inheritdoc />
public IReadOnlyCollection < ImageFormat > GetSupportedImageOutputFormats ( )
@ -26,11 +26,9 @@ namespace Jellyfin.Extensions
/// <returns>All lines in the stream.</returns>
public static string [ ] ReadAllLines ( this Stream stream , Encoding encoding )
{
using ( StreamReader reader = new StreamReader ( stream , encoding ) )
{
using StreamReader reader = new StreamReader ( stream , encoding ) ;
return ReadAllLines ( reader ) . ToArray ( ) ;
}
}
/// <summary>
/// Reads all lines in the <see cref="TextReader" />.
@ -12,8 +12,8 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
[Fact]
public void Parse_Valid_Success ( )
{
using ( var stream = File . OpenRead ( "Test Data/example.ass" ) )
{
using var stream = File . OpenRead ( "Test Data/example.ass" ) ;
var parsed = new SubtitleEditParser ( new NullLogger < SubtitleEditParser > ( ) ) . Parse ( stream , "ass" ) ;
Assert . Single ( parsed . TrackEvents ) ;
var trackEvent = parsed . TrackEvents [ 0 ] ;
@ -25,4 +25,3 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
}
}
}
}
@ -12,8 +12,8 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
[Fact]
public void Parse_Valid_Success ( )
{
using ( var stream = File . OpenRead ( "Test Data/example.srt" ) )
{
using var stream = File . OpenRead ( "Test Data/example.srt" ) ;
var parsed = new SubtitleEditParser ( new NullLogger < SubtitleEditParser > ( ) ) . Parse ( stream , "srt" ) ;
Assert . Equal ( 2 , parsed . TrackEvents . Count ) ;
@ -29,13 +29,12 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
Assert . Equal ( TimeSpan . Parse ( "00:02:22.501" , CultureInfo . InvariantCulture ) . Ticks , trackEvent2 . EndPositionTicks ) ;
Assert . Equal ( "Very good, Lieutenant." , trackEvent2 . Text ) ;
}
}
[Fact]
public void Parse_EmptyNewlineBetweenText_Success ( )
{
using ( var stream = File . OpenRead ( "Test Data/example2.srt" ) )
{
using var stream = File . OpenRead ( "Test Data/example2.srt" ) ;
var parsed = new SubtitleEditParser ( new NullLogger < SubtitleEditParser > ( ) ) . Parse ( stream , "srt" ) ;
Assert . Equal ( 2 , parsed . TrackEvents . Count ) ;
@ -53,4 +52,3 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
}
}
}
}
@ -18,8 +18,8 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
[MemberData(nameof(Parse_MultipleDialogues_TestData))]
public void Parse_MultipleDialogues_Success ( string ssa , IReadOnlyList < SubtitleTrackEvent > expectedSubtitleTrackEvents )
{
using ( Stream stream = new MemoryStream ( Encoding . UTF8 . GetBytes ( ssa ) ) )
{
using Stream stream = new MemoryStream ( Encoding . UTF8 . GetBytes ( ssa ) ) ;
SubtitleTrackInfo subtitleTrackInfo = _parser . Parse ( stream , "ssa" ) ;
Assert . Equal ( expectedSubtitleTrackEvents . Count , subtitleTrackInfo . TrackEvents . Count ) ;
@ -35,7 +35,6 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
Assert . Equal ( expected . EndPositionTicks , actual . EndPositionTicks ) ;
}
}
}
public static TheoryData < string , IReadOnlyList < SubtitleTrackEvent > > Parse_MultipleDialogues_TestData ( )
{
@ -73,8 +72,8 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
[Fact]
public void Parse_Valid_Success ( )
{
using ( var stream = File . OpenRead ( "Test Data/example.ssa" ) )
{
using var stream = File . OpenRead ( "Test Data/example.ssa" ) ;
var parsed = _parser . Parse ( stream , "ssa" ) ;
Assert . Single ( parsed . TrackEvents ) ;
var trackEvent = parsed . TrackEvents [ 0 ] ;
@ -86,4 +85,3 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
}
}
}
}
@ -488,8 +488,9 @@ namespace Jellyfin.Model.Tests
private static async ValueTask < T > TestData < T > ( string name )
{
var path = Path . Join ( "Test Data" , typeof ( T ) . Name + "-" + name + ".json" ) ;
using ( var stream = File . OpenRead ( path ) )
{
using var stream = File . OpenRead ( path ) ;
var value = await JsonSerializer . DeserializeAsync < T > ( stream , JsonDefaults . Options ) ;
if ( value is not null )
{
@ -498,7 +499,6 @@ namespace Jellyfin.Model.Tests
throw new SerializationException ( "Invalid test data: " + name ) ;
}
}
private StreamBuilder GetStreamBuilder ( )
{