[PR #6383] [MERGED] Made default parser a tiny bit more robust #10937

Closed
opened 2026-02-07 06:29:31 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/6383
Author: @sushilicious
Created: 8/4/2021
Status: Merged
Merged: 10/26/2021
Merged by: @cvium

Base: masterHead: master


📝 Commits (5)

📊 Changes

3 files changed (+28 additions, -10 deletions)

View changed files

📝 Emby.Naming/Common/NamingOptions.cs (+5 -2)
📝 Emby.Naming/Video/CleanStringParser.cs (+16 -7)
📝 tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs (+7 -1)

📄 Description

This addresses #6382. While it doesn't solve the overall problem of having a more robust name parser, it is a stopgap to make some things work.

Changes

  1. Updated CleanStringParser to discard any "[...]" at the beginning of a string.
  2. Removes things like "E01-16" at end of file names.
  3. Removes things like "- 03" at end of file names.
  4. Changed structure of CleanStringParser to repeatedly these expressions until there is nothing left to be clean (This helps makes the regular expressions easier to comprehend).
  5. Also added some test cases to ensure new rules work.

Issues
Addresses #6382.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/6383 **Author:** [@sushilicious](https://github.com/sushilicious) **Created:** 8/4/2021 **Status:** ✅ Merged **Merged:** 10/26/2021 **Merged by:** [@cvium](https://github.com/cvium) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (5) - [`26f8b50`](https://github.com/jellyfin/jellyfin/commit/26f8b501e77b7bd9a73028637e82de2f2605dd3a) Made CleanStringParser more robust - [`460fe76`](https://github.com/jellyfin/jellyfin/commit/460fe76467031cd8dd89dff737575d2fc7310844) Merge branch 'master' of https://github.com/jellyfin/jellyfin - [`7fdef4b`](https://github.com/jellyfin/jellyfin/commit/7fdef4b82b82cb882fd378bdad04420157fecae2) Merge branch 'master' of https://github.com/jellyfin/jellyfin into HEAD - [`b2a1060`](https://github.com/jellyfin/jellyfin/commit/b2a10609af703b1c513570d6c397ff22e0214bb0) Made CleanStringParser go through regexps only once - [`6bc7d78`](https://github.com/jellyfin/jellyfin/commit/6bc7d78f6fbef9e47731a4991ca72d3ba4c23bce) Update Emby.Naming/Video/CleanStringParser.cs ### 📊 Changes **3 files changed** (+28 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Naming/Common/NamingOptions.cs` (+5 -2) 📝 `Emby.Naming/Video/CleanStringParser.cs` (+16 -7) 📝 `tests/Jellyfin.Naming.Tests/Video/CleanStringTests.cs` (+7 -1) </details> ### 📄 Description This addresses #6382. While it doesn't solve the overall problem of having a more robust name parser, it is a stopgap to make some things work. **Changes** 1. Updated CleanStringParser to discard any "[...]" at the beginning of a string. 2. Removes things like "E01-16" at end of file names. 3. Removes things like "- 03" at end of file names. 4. Changed structure of CleanStringParser to repeatedly these expressions until there is nothing left to be clean (This helps makes the regular expressions easier to comprehend). 5. Also added some test cases to ensure new rules work. **Issues** Addresses #6382. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:29:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10937