Browse Source

Fix channel logo migration (#32)

* fix channel logo migration

* add onscreen episode-num to epg

* bump log level for nfo parse failures
pull/33/head
Jason Dove 4 years ago committed by GitHub
parent
commit
9568a0e22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ErsatzTV.Core/Iptv/ChannelGuide.cs
  2. 6
      ErsatzTV.Core/Metadata/LocalMetadataProvider.cs
  3. 4
      ErsatzTV/Extensions/HostExtensions.cs

5
ErsatzTV.Core/Iptv/ChannelGuide.cs

@ -108,6 +108,11 @@ namespace ErsatzTV.Core.Iptv @@ -108,6 +108,11 @@ namespace ErsatzTV.Core.Iptv
xml.WriteAttributeString("system", "xmltv_ns");
xml.WriteString($"{s - 1}.{e - 1}.0/1");
xml.WriteEndElement(); // episode-num
xml.WriteStartElement("episode-num");
xml.WriteAttributeString("system", "onscreen");
xml.WriteString($"S{s:00}E{e:00}");
xml.WriteEndElement(); // episode-num
}
}

6
ErsatzTV.Core/Metadata/LocalMetadataProvider.cs

@ -218,7 +218,7 @@ namespace ErsatzTV.Core.Metadata @@ -218,7 +218,7 @@ namespace ErsatzTV.Core.Metadata
}
catch (Exception ex)
{
_logger.LogDebug(ex, "Failed to read TV show nfo metadata from {Path}", nfoFileName);
_logger.LogInformation(ex, "Failed to read TV show nfo metadata from {Path}", nfoFileName);
return None;
}
}
@ -246,7 +246,7 @@ namespace ErsatzTV.Core.Metadata @@ -246,7 +246,7 @@ namespace ErsatzTV.Core.Metadata
}
catch (Exception ex)
{
_logger.LogDebug(ex, "Failed to read TV episode nfo metadata from {Path}", nfoFileName);
_logger.LogInformation(ex, "Failed to read TV episode nfo metadata from {Path}", nfoFileName);
return FallbackMetadataProvider.GetFallbackMetadata(episode);
}
}
@ -273,7 +273,7 @@ namespace ErsatzTV.Core.Metadata @@ -273,7 +273,7 @@ namespace ErsatzTV.Core.Metadata
}
catch (Exception ex)
{
_logger.LogDebug(ex, "Failed to read Movie nfo metadata from {Path}", nfoFileName);
_logger.LogInformation(ex, "Failed to read Movie nfo metadata from {Path}", nfoFileName);
return FallbackMetadataProvider.GetFallbackMetadata(mediaItem);
}
}

4
ErsatzTV/Extensions/HostExtensions.cs

@ -3,6 +3,7 @@ using System.IO; @@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using ErsatzTV.Core;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Interfaces.Metadata;
using ErsatzTV.Infrastructure.Data;
using LanguageExt;
using Microsoft.EntityFrameworkCore;
@ -68,6 +69,7 @@ namespace ErsatzTV.Extensions @@ -68,6 +69,7 @@ namespace ErsatzTV.Extensions
.Map(a => a.Path)
.ToList();
ILocalFileSystem localFileSystem = provider.GetRequiredService<ILocalFileSystem>();
foreach (string logo in logos)
{
string legacyPath = Path.Combine(FileSystemLayout.LegacyImageCacheFolder, logo);
@ -75,7 +77,7 @@ namespace ErsatzTV.Extensions @@ -75,7 +77,7 @@ namespace ErsatzTV.Extensions
{
string subfolder = logo.Substring(0, 2);
string newPath = Path.Combine(FileSystemLayout.LogoCacheFolder, subfolder, logo);
File.Copy(legacyPath, newPath, true);
localFileSystem.CopyFile(legacyPath, newPath);
}
}

Loading…
Cancel
Save