mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-27 20:45:03 +01:00
update globalize
This commit is contained in:
@@ -939,26 +939,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
}
|
||||
}
|
||||
|
||||
var fileInfo = new DirectoryInfo(path);
|
||||
|
||||
var isNew = false;
|
||||
|
||||
if (!fileInfo.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
fileInfo = Directory.CreateDirectory(path);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
_logger.Error("Error creating directory {0}", ex, path);
|
||||
throw new Exception(string.Format("Error creating directory {0}", path), ex);
|
||||
}
|
||||
|
||||
isNew = true;
|
||||
}
|
||||
|
||||
var item = isNew ? null : GetItemById(id) as T;
|
||||
var item = GetItemById(id) as T;
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
@@ -966,8 +947,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
Name = name,
|
||||
Id = id,
|
||||
DateCreated = _fileSystem.GetCreationTimeUtc(fileInfo),
|
||||
DateModified = _fileSystem.GetLastWriteTimeUtc(fileInfo),
|
||||
DateCreated = DateTime.UtcNow,
|
||||
DateModified = DateTime.UtcNow,
|
||||
Path = path
|
||||
};
|
||||
}
|
||||
@@ -980,6 +961,59 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
return item;
|
||||
}
|
||||
|
||||
public IEnumerable<MusicArtist> GetAlbumArtists(IEnumerable<IHasAlbumArtist> items)
|
||||
{
|
||||
var names = items
|
||||
.SelectMany(i => i.AlbumArtists)
|
||||
.DistinctNames()
|
||||
.Select(i =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var artist = GetArtist(i);
|
||||
|
||||
return artist;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Already logged at lower levels
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(i => i != null);
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
public IEnumerable<MusicArtist> GetArtists(IEnumerable<IHasArtist> items)
|
||||
{
|
||||
var names = items
|
||||
.SelectMany(i => i.AllArtists)
|
||||
.DistinctNames()
|
||||
.Select(i =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var artist = GetArtist(i);
|
||||
|
||||
return artist;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Already logged at lower levels
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(i => i != null);
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
private void SetPropertiesFromSongs(MusicArtist artist, IEnumerable<IHasMetadata> items)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate and refresh the People sub-set of the IBN.
|
||||
/// The items are stored in the db but not loaded into memory until actually requested by an operation.
|
||||
@@ -2118,6 +2152,11 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
public Task UpdatePeople(BaseItem item, List<PersonInfo> people)
|
||||
{
|
||||
if (!item.SupportsPeople)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
return ItemRepository.UpdatePeople(item.Id, people);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,26 +48,22 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
.Cast<IHasArtist>()
|
||||
.ToList();
|
||||
|
||||
var allArtists = allSongs.SelectMany(i => i.AllArtists)
|
||||
.DistinctNames()
|
||||
.ToList();
|
||||
var allArtists = _libraryManager.GetArtists(allSongs).ToList();
|
||||
|
||||
var numComplete = 0;
|
||||
var numArtists = allArtists.Count;
|
||||
|
||||
foreach (var artist in allArtists)
|
||||
foreach (var artistItem in allArtists)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
try
|
||||
{
|
||||
var artistItem = _libraryManager.GetArtist(artist);
|
||||
|
||||
await artistItem.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.ErrorException("Error validating Artist {0}", ex, artist);
|
||||
_logger.ErrorException("Error validating Artist {0}", ex, artistItem.Name);
|
||||
}
|
||||
|
||||
// Update progress
|
||||
|
||||
@@ -1398,14 +1398,40 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
dto.EpisodeTitle = program.EpisodeTitle;
|
||||
dto.ChannelType = program.ChannelType;
|
||||
dto.Audio = program.Audio;
|
||||
dto.IsHD = program.IsHD;
|
||||
dto.IsMovie = program.IsMovie;
|
||||
dto.IsSeries = program.IsSeries;
|
||||
dto.IsSports = program.IsSports;
|
||||
dto.IsLive = program.IsLive;
|
||||
dto.IsNews = program.IsNews;
|
||||
dto.IsKids = program.IsKids;
|
||||
dto.IsPremiere = program.IsPremiere;
|
||||
|
||||
if (program.IsHD.HasValue && program.IsHD.Value)
|
||||
{
|
||||
dto.IsHD = program.IsHD;
|
||||
}
|
||||
if (program.IsMovie)
|
||||
{
|
||||
dto.IsMovie = program.IsMovie;
|
||||
}
|
||||
if (program.IsSeries)
|
||||
{
|
||||
dto.IsSeries = program.IsSeries;
|
||||
}
|
||||
if (program.IsSports)
|
||||
{
|
||||
dto.IsSports = program.IsSports;
|
||||
}
|
||||
if (program.IsLive)
|
||||
{
|
||||
dto.IsLive = program.IsLive;
|
||||
}
|
||||
if (program.IsNews)
|
||||
{
|
||||
dto.IsNews = program.IsNews;
|
||||
}
|
||||
if (program.IsKids)
|
||||
{
|
||||
dto.IsKids = program.IsKids;
|
||||
}
|
||||
if (program.IsPremiere)
|
||||
{
|
||||
dto.IsPremiere = program.IsPremiere;
|
||||
}
|
||||
|
||||
dto.OriginalAirDate = program.OriginalAirDate;
|
||||
|
||||
if (channel != null)
|
||||
|
||||
@@ -155,12 +155,6 @@ namespace MediaBrowser.Server.Implementations.UserViews
|
||||
SpecialFolder.MovieMovies,
|
||||
SpecialFolder.MovieResume,
|
||||
|
||||
SpecialFolder.GameFavorites,
|
||||
SpecialFolder.GameGenres,
|
||||
SpecialFolder.GameSystems,
|
||||
SpecialFolder.LatestGames,
|
||||
SpecialFolder.RecentlyPlayedGames,
|
||||
|
||||
SpecialFolder.MusicArtists,
|
||||
SpecialFolder.MusicAlbumArtists,
|
||||
SpecialFolder.MusicAlbums,
|
||||
|
||||
Reference in New Issue
Block a user