Browse Source

exclude strm files from jellyfin scanners (#249)

* exclude strm files from jellyfin scanners

* update changelog
pull/250/head
Jason Dove 4 years ago committed by GitHub
parent
commit
e20f9be702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 13
      ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs
  3. 2889
      ErsatzTV.Infrastructure/Migrations/20210607123805_Delete_JellyfinStrmFiles.Designer.cs
  4. 21
      ErsatzTV.Infrastructure/Migrations/20210607123805_Delete_JellyfinStrmFiles.cs
  5. 1
      ErsatzTV.sln.DotSettings

1
CHANGELOG.md

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Ignore unsupported plex guids (this prevented some libraries from scanning correctly)
- Ignore unsupported STRM files from Jellyfin
## [0.0.43-prealpha] - 2021-06-05
### Added

13
ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@ -235,6 +236,12 @@ namespace ErsatzTV.Infrastructure.Jellyfin @@ -235,6 +236,12 @@ namespace ErsatzTV.Infrastructure.Jellyfin
return None;
}
if (Path.GetExtension(item.Path)?.ToLowerInvariant() == ".strm")
{
_logger.LogInformation("STRM files are not supported; skipping {Path}", item.Path);
return None;
}
var version = new MediaVersion
{
Name = "Main",
@ -543,6 +550,12 @@ namespace ErsatzTV.Infrastructure.Jellyfin @@ -543,6 +550,12 @@ namespace ErsatzTV.Infrastructure.Jellyfin
return None;
}
if (Path.GetExtension(item.Path)?.ToLowerInvariant() == ".strm")
{
_logger.LogWarning("STRM files are not supported; skipping {Path}", item.Path);
return None;
}
var version = new MediaVersion
{
Name = "Main",

2889
ErsatzTV.Infrastructure/Migrations/20210607123805_Delete_JellyfinStrmFiles.Designer.cs generated

File diff suppressed because it is too large Load Diff

21
ErsatzTV.Infrastructure/Migrations/20210607123805_Delete_JellyfinStrmFiles.cs

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Delete_JellyfinStrmFiles : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
@"DELETE FROM MediaItem WHERE Id IN
(SELECT MI.Id FROM MediaItem MI
INNER JOIN MediaVersion MV on MV.MovieId = MI.Id
INNER JOIN MediaFile MF on MV.Id = MF.MediaVersionId
WHERE MF.Path LIKE '%.strm')");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

1
ErsatzTV.sln.DotSettings

@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=probesize/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=setsar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=showtitle/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=strm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tvdb/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tvshow/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=uniqueid/@EntryIndexedValue">True</s:Boolean>

Loading…
Cancel
Save