aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md12
-rw-r--r--.github/ISSUE_TEMPLATE/enhancement-request.md8
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md4
-rw-r--r--.github/pull_request_template.md8
-rw-r--r--Emby.Naming/Video/VideoListResolver.cs66
-rw-r--r--Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs21
6 files changed, 47 insertions, 72 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 4abd39cfc..137a689e8 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -8,23 +8,23 @@ assignees: ''
---
**Describe the bug**
-A clear and concise description of what the bug is.
+<!-- A clear and concise description of what the bug is. -->
**To Reproduce**
-Steps to reproduce the behavior:
+<!-- Steps to reproduce the behavior: -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
-A clear and concise description of what you expected to happen.
+<!-- A clear and concise description of what you expected to happen. -->
**Logs**
-Please paste any log errors.
+<!-- Please paste any log errors. -->
**Screenshots**
-If applicable, add screenshots to help explain your problem.
+<!-- If applicable, add screenshots to help explain your problem. -->
**System (please complete the following information):**
- OS: [e.g. Docker, Debian, Windows]
@@ -32,4 +32,4 @@ If applicable, add screenshots to help explain your problem.
- Jellyfin Version: [e.g. 10.0.1]
**Additional context**
-Add any other context about the problem here.
+<!-- Add any other context about the problem here. -->
diff --git a/.github/ISSUE_TEMPLATE/enhancement-request.md b/.github/ISSUE_TEMPLATE/enhancement-request.md
index 57c0d4cae..a655b60f5 100644
--- a/.github/ISSUE_TEMPLATE/enhancement-request.md
+++ b/.github/ISSUE_TEMPLATE/enhancement-request.md
@@ -8,13 +8,13 @@ assignees: ''
---
**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
+<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
+<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
-Add any other context or screenshots about the feature request here.
+<!-- Add any other context or screenshots about the feature request here. -->
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index a2ce07245..3cbc8cbb9 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -8,7 +8,7 @@ assignees: ''
---
**Describe the feature you'd like**
-A clear and concise description of what you want to happen.
+<!-- A clear and concise description of what you want to happen. -->
**Additional context**
-Add any other context or screenshots about the feature request here.
+<!-- Add any other context or screenshots about the feature request here. -->
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index b2b3cf241..967be0fb7 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,9 +1,11 @@
+<!--
Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y).
For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our https://jellyfin.readthedocs.io/en/latest/developer-docs/contributing/ page.
+-->
**Changes**
-Describe your changes here in 1-5 sentences.
+<!-- Describe your changes here in 1-5 sentences. -->
**Issues**
-Tag any issues that this PR solves here.
-Fixes #
+<!-- Tag any issues that this PR solves here.
+ex. Fixes # -->
diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs
index 0506d0734..ef97b8739 100644
--- a/Emby.Naming/Video/VideoListResolver.cs
+++ b/Emby.Naming/Video/VideoListResolver.cs
@@ -175,71 +175,23 @@ namespace Emby.Naming.Video
return videos;
}
- var list = new List<VideoInfo>();
-
var folderName = Path.GetFileName(Path.GetDirectoryName(videos[0].Files[0].Path));
if (!string.IsNullOrEmpty(folderName) && folderName.Length > 1)
{
- if (videos.All(i => i.Files.Count == 1 && IsEligibleForMultiVersion(folderName, i.Files[0].Path)))
- {
- // Enforce the multi-version limit
- if (videos.Count <= 8 && HaveSameYear(videos))
- {
- var ordered = videos.OrderBy(i => i.Name).ToList();
-
- list.Add(ordered[0]);
-
- list[0].AlternateVersions = ordered.Skip(1).Select(i => i.Files[0]).ToList();
- list[0].Name = folderName;
- list[0].Extras.AddRange(ordered.Skip(1).SelectMany(i => i.Extras));
+ var ordered = videos.OrderBy(i => i.Name);
- return list;
- }
- }
+ return ordered.GroupBy(v => new {v.Name, v.Year}).Select(group => new VideoInfo
+ {
+ Name = folderName,
+ Year = group.First().Year,
+ Files = group.First().Files,
+ AlternateVersions = group.Skip(1).Select(i => i.Files[0]).ToList(),
+ Extras = group.First().Extras.Concat(group.Skip(1).SelectMany(i => i.Extras)).ToList()
+ });
}
return videos;
- //foreach (var video in videos.OrderBy(i => i.Name))
- //{
- // var match = list
- // .FirstOrDefault(i => string.Equals(i.Name, video.Name, StringComparison.OrdinalIgnoreCase));
-
- // if (match != null && video.Files.Count == 1 && match.Files.Count == 1)
- // {
- // match.AlternateVersions.Add(video.Files[0]);
- // match.Extras.AddRange(video.Extras);
- // }
- // else
- // {
- // list.Add(video);
- // }
- //}
-
- //return list;
- }
-
- private bool HaveSameYear(List<VideoInfo> videos)
- {
- return videos.Select(i => i.Year ?? -1).Distinct().Count() < 2;
- }
-
- private bool IsEligibleForMultiVersion(string folderName, string testFilename)
- {
- testFilename = Path.GetFileNameWithoutExtension(testFilename);
-
- if (string.Equals(folderName, testFilename, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
-
- if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase))
- {
- testFilename = testFilename.Substring(folderName.Length).Trim();
- return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase) || Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == string.Empty;
- }
-
- return false;
}
private List<VideoFileInfo> GetExtras(IEnumerable<VideoFileInfo> remainingFiles, List<string> baseNames)
diff --git a/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs b/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..ea1c457f6
--- /dev/null
+++ b/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs
@@ -0,0 +1,21 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Jellyfin.Drawing.Skia")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Jellyfin Project")]
+[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]