Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/commit/cc92f7afe599c9d1c4bfa35a67f6e89d1a790107
You should set ROOT_URL correctly, otherwise the web may not work correctly.
13 changed files with
42 additions and
26 deletions
@ -1,4 +1,4 @@
<Project Sdk= "Microsoft.NET.Sdk" >
<Project Sdk= "Microsoft.NET.Sdk" >
<PropertyGroup >
<TargetFramework > net5.0</TargetFramework>
@ -1,4 +1,4 @@
<Project Sdk= "Microsoft.NET.Sdk" >
<Project Sdk= "Microsoft.NET.Sdk" >
<!-- ProjectGuid is only included as a requirement for SonarQube analysis -->
<PropertyGroup >
@ -5,17 +5,32 @@ namespace MediaBrowser.Model.Providers
/// </summary>
public class ExternalIdInfo
{
/// <summary>
/// Represents the external id information for serialization to the client.
/// </summary>
/// <param name="name">Name of the external id provider (IE: IMDB, MusicBrainz, etc).</param>
/// <param name="key">Key for this id. This key should be unique across all providers.</param>
/// <param name="type">Specific media type for this id</param>
/// <param name="urlFormatString">URL format string.</param>
public ExternalIdInfo ( string name , string key , ExternalIdMediaType ? type , string urlFormatString )
{
Name = name ;
Key = key ;
Type = type ;
UrlFormatString = urlFormatString ;
}
/// <summary>
/// Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).
/// </summary>
// TODO: This should be renamed to ProviderName
public string? Name { get ; set ; }
public string Name { get ; set ; }
/// <summary>
/// Gets or sets the unique key for this id. This key should be unique across all providers.
/// </summary>
// TODO: This property is not actually unique across the concrete types at the moment. It should be updated to be unique.
public string? Key { get ; set ; }
public string Key { get ; set ; }
/// <summary>
/// Gets or sets the specific media type for this id. This is used to distinguish between the different
@ -31,6 +46,6 @@ namespace MediaBrowser.Model.Providers
/// <summary>
/// Gets or sets the URL format string.
/// </summary>
public string ? UrlFormatString { get ; set ; }
public string UrlFormatString { get ; set ; }
}
}
@ -960,13 +960,11 @@ namespace MediaBrowser.Providers.Manager
public IEnumerable < ExternalIdInfo > GetExternalIdInfos ( IHasProviderIds item )
{
return GetExternalIds ( item )
. Select ( i = > new ExternalIdInfo
{
Name = i . ProviderName ,
Key = i . Key ,
Type = i . Type ,
UrlFormatString = i . UrlFormatString
} ) ;
. Select ( i = > new ExternalIdInfo (
name : i . ProviderName ,
key : i . Key ,
type : i . Type ,
urlFormatString : i . UrlFormatString ) ) ;
}
/// <inheritdoc/>
@ -41,7 +41,7 @@ namespace MediaBrowser.XbmcMetadata
return Task . CompletedTask ;
}
private void OnUserDataSaved ( object sender , UserDataSaveEventArgs e )
private void OnUserDataSaved ( object ? sender , UserDataSaveEventArgs e )
{
if ( e . SaveReason = = UserDataSaveReason . PlaybackFinished | | e . SaveReason = = UserDataSaveReason . TogglePlayed | | e . SaveReason = = UserDataSaveReason . UpdateUserRating )
{
@ -19,6 +19,7 @@
<GenerateAssemblyInfo > false</GenerateAssemblyInfo>
<GenerateDocumentationFile > true</GenerateDocumentationFile>
<TreatWarningsAsErrors > true</TreatWarningsAsErrors>
<Nullable > enable</Nullable>
</PropertyGroup>
<!-- Code Analyzers -->
@ -37,6 +37,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
Logger = logger ;
_config = config ;
ProviderManager = providerManager ;
_validProviderIds = new Dictionary < string , string > ( ) ;
}
protected CultureInfo UsCulture { get ; } = new CultureInfo ( "en-US" ) ;
@ -72,7 +73,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
throw new ArgumentException ( "The metadata file was empty or null." , nameof ( metadataFile ) ) ;
}
_validProviderIds = _validProviderIds = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
_validProviderIds = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
var idInfos = ProviderManager . GetExternalIdInfos ( item . Item ) ;
@ -376,7 +377,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
return null ;
} ) . Where( i = > i . HasValue ) . Select ( i = > i . Value ) . ToArray ( ) ;
} ) . OfType< MetadataField > ( ) . ToArray ( ) ;
}
break ;
@ -711,10 +712,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
default :
string readerName = reader . Name ;
if ( _validProviderIds . TryGetValue ( readerName , out string providerIdValue ) )
if ( _validProviderIds . TryGetValue ( readerName , out string ? providerIdValue ) )
{
var id = reader . ReadElementContentAsString ( ) ;
if ( ! string . IsNullOrWhiteSpace ( id) )
if ( ! string . IsNullOrWhiteSpace ( providerIdValue) & & ! string . IsNullOrWhiteSpace ( id) )
{
item . SetProviderId ( providerIdValue , id ) ;
}
@ -39,8 +39,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
case "id" :
{
string imdbId = reader . GetAttribute ( "IMDB" ) ;
string tmdbId = reader . GetAttribute ( "TMDB" ) ;
string ? imdbId = reader . GetAttribute ( "IMDB" ) ;
string ? tmdbId = reader . GetAttribute ( "TMDB" ) ;
if ( string . IsNullOrWhiteSpace ( imdbId ) )
{
@ -40,9 +40,9 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
case "id" :
{
string imdbId = reader . GetAttribute ( "IMDB" ) ;
string tmdbId = reader . GetAttribute ( "TMDB" ) ;
string tvdbId = reader . GetAttribute ( "TVDB" ) ;
string ? imdbId = reader . GetAttribute ( "IMDB" ) ;
string ? tmdbId = reader . GetAttribute ( "TMDB" ) ;
string ? tvdbId = reader . GetAttribute ( "TVDB" ) ;
if ( string . IsNullOrWhiteSpace ( tvdbId ) )
{
@ -74,6 +74,6 @@ namespace MediaBrowser.XbmcMetadata.Providers
protected abstract void Fetch ( MetadataResult < T > result , string path , CancellationToken cancellationToken ) ;
protected abstract FileSystemMetadata GetXmlFile ( ItemInfo info , IDirectoryService directoryService ) ;
protected abstract FileSystemMetadata ? GetXmlFile ( ItemInfo info , IDirectoryService directoryService ) ;
}
}
@ -50,7 +50,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
}
/// <inheritdoc />
protected override FileSystemMetadata GetXmlFile ( ItemInfo info , IDirectoryService directoryService )
protected override FileSystemMetadata ? GetXmlFile ( ItemInfo info , IDirectoryService directoryService )
{
return MovieNfoSaver . GetMovieSavePaths ( info )
. Select ( directoryService . GetFile )
@ -200,7 +200,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
private void SaveToFile ( Stream stream , string path )
{
Directory . CreateDirectory ( Path . GetDirectoryName ( path ) ) ;
var directory = Path . GetDirectoryName ( path ) ? ? throw new ArgumentException ( $"Provided path ({path}) is not valid." , nameof ( path ) ) ;
Directory . CreateDirectory ( directory ) ;
// On Windows, savint the file will fail if the file is hidden or readonly
FileSystem . SetAttributes ( path , false , false ) ;
@ -41,7 +41,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
/// <inheritdoc />
protected override string GetLocalSavePath ( BaseItem item )
= > GetMovieSavePaths ( new ItemInfo ( item ) ) . FirstOrDefault ( ) ;
= > GetMovieSavePaths ( new ItemInfo ( item ) ) . FirstOrDefault ( ) ? ? Path . ChangeExtension ( item . Path , ".nfo" ) ;
internal static IEnumerable < string > GetMovieSavePaths ( ItemInfo item )
{