mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
Properly handle file access issues in some cases (#14272)
This commit is contained in:
parent
1c4c9cf733
commit
c22f24319b
2 changed files with 22 additions and 4 deletions
|
|
@ -94,7 +94,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(result.strArtist))
|
||||
{
|
||||
item.AlbumArtists = new string[] { result.strArtist };
|
||||
item.AlbumArtists = [result.strArtist];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result.intYearReleased))
|
||||
|
|
@ -104,7 +104,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
|
|||
|
||||
if (!string.IsNullOrEmpty(result.strGenre))
|
||||
{
|
||||
item.Genres = new[] { result.strGenre };
|
||||
item.Genres = [result.strGenre];
|
||||
}
|
||||
|
||||
item.SetProviderId(MetadataProvider.AudioDbArtist, result.idArtist);
|
||||
|
|
@ -170,6 +170,11 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
|
|||
var url = AudioDbArtistProvider.BaseUrl + "/album-mb.php?i=" + musicBrainzReleaseGroupId;
|
||||
|
||||
var path = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId);
|
||||
var fileInfo = _fileSystem.GetFileSystemInfo(path);
|
||||
if (fileInfo.Exists && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue