Use a better parser for local files

Hello,

I tested sonarr but instead of using plex, I suggest to use my parser for that

The medium article : https://medium.com/@jy95/mediascan-4d4ad1151ccb
The github : https://github.com/jy95/mediaScan

What do you think about it ?

I’m not entirely sure what your asking for in this feature request, Sonarr does it’s own parsing completely independent of plex.

But I suggest you run your code against our testcases:

I don’t see us adopting any external parser.

I use the example of Plex because most of the media files I tested on sonarr weren’t correctly understood in local files. I forgot to say It does more than a basic parser : You are free to use your own parser (I listed 3) but got the avantages for filtering functions ^^

I checked the repository parser : https://github.com/Sonarr/Sonarr/tree/develop/src/NzbDrone.Core/Parser
. The thing I suggest with this proposal is to discuss about a clean parser

So which filenames do you have trouble with in Sonarr?

‘filtering’ functions, as I understand from glancing your repository, seem to be a library function which has nothing to do with parsing. Parsing turns a filename into metadata. Filtering operates on a collection of metadata, but it entirely out of scope for Sonarr.

I’m still not sure what you’re asking of us, perhaps it simply gets lost in translation.

The library functions is not something we need in Sonarr.
Neither of the 3 parsers you mentioned seem to be able to cover multi-episode and anime. And the 3rd parser you mentioned is actually inspired by Sonarr’s parser, based on comments. None of them have extensive test suites.

As mentioned, we have a fairly extensive test suite. There are a few cases that are tough to handle and usually referred to https://github.com/Sonarr/Sonarr/issues/457, non-public work done on that issue uses heuristics instead of a plain static parser in order to better handle the edge cases, but it’s far from ready. And is a pretty serious undertaking.

Filename like the one you show in the issue ^^
What I was expecting was a clear doc that document all the naming scheme used (I saw this but not the equivalent about movies : https://github.com/Sonarr/Sonarr/wiki/Anime-naming-scheme ) instead of inspecting the parser code.

For the filtering, It just because I found the API a bit poor : As far I can see, nothing allows that ( https://github.com/Sonarr/Sonarr/wiki/EpisodeFile or https://github.com/Sonarr/Sonarr/wiki/Episode ) . For example, imagine you want to show new series in the current year, directly in the interface of sonarr :slight_smile:

About the heuristics , depending how it is implemented, it is mostly magic ^^ It seems naming convention is a bit of mess compared to commit convention like Angular or Eslint

The naming schemes in the wiki are how Sonarr formats the files during rename, not how Sonarr parses files.
The parsing logic in Sonarr is mostly based on an ordered list of regular expressions intended to handle a variety of formats discovered over the years.

You opened this topic about ‘better parser for local files’ and linked to a project that is essentially an queryable media library while advertising it as a better parser. It’s not usable in Sonarr.
If the parsers you integrated in your project used algorithms that proved to be more effective, then we could’ve considered updating our parser, but they don’t.

ok : I wasn’t inspired when I choose the title ^^.
As far that I know, parse-torrent-title doesn’t support multi-episode or anime yet but allows advanced usage (https://github.com/clement-escolano/parse-torrent-title#advanced-usage) . I didn’t found a cleaner parser yet.

I can also update my queryable library to handle multi episode easilly if I found a better parser ^^

As mentioned earlier, we have no plans to support an external parser.
Additionally Sonarr v3 has an improved api that possibly makes it easier to apply filters to queries by third-party applications, but that’s not available yet.

Ok, At least, I know it will be possible to make filters in the future XD

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.