GNOME Bugzilla – Bug 725026
Add support for SeasonxEpisode filename format
Last modified: 2014-03-27 19:22:14 UTC
Hi. If it's not too difficult, please add support for these formats: Show Name - SeasonxEpisode - Episode Name.mp4 (replace Season and Episode with the number of the episode. Sometimes two digits each, sometimes one) Season/Ep. 02 Episode Name.mkv (Each season in its own directory, inside each season directory, files only have episode number, no season number) Cowboy Bebop - Session 02 - Stray Dog Strut [720p].mkv (Speacialcase for Cowboy Bebop, where there's only one season and Episodes are called "Sessions". I know asking for a special case is a bit too much, but it doesn't hurt to try, does it?) Show Name.01.mkv (Some shows have only one seasons, so episode numbers might not have any special prefix) These are all the formats I can think of right now. And as always, thanks for your awesome work, grilo (and its use in Totem) is awesome.
Created attachment 270437 [details] [review] [PATCH] local-metadata: Support seasonxepisode format in filenames This patch adds support for the 5x24 format, or at least it should, if I did it right. I'm not sure if it's worth to support the other formats I listed here, to be honest.
Created attachment 270467 [details] [review] local-metadata: Add tests for episode name parsing This will allow us to fix old regular expressions, and add new ones to detect season and episode numbers, without creating regressions.
Comment on attachment 270467 [details] [review] local-metadata: Add tests for episode name parsing Attachment 270467 [details] pushed as 482944a - local-metadata: Add tests for episode name parsing
(In reply to comment #1) > Created an attachment (id=270437) [details] [review] > [PATCH] local-metadata: Support seasonxepisode format in filenames > > This patch adds support for the 5x24 format, or at least it should, if I did it > right. You can add a test for it in the test_local_metadata.c file, and see that for yourself. We'll also need to use this to detect false positives like in bug 725025. > I'm not sure if it's worth to support the other formats I listed here, to be > honest. I don't think the other formats are parseable without many many false positives. For all the rest of those, we'll need to implement series support in the tmdb plugin or add a new tvdb plugin (bug 672933).
Review of attachment 270437 [details] [review]: Marking as needs-work as it needs a test case added to the test suite (to make sure it works :)
Created attachment 270503 [details] [review] [PATCH] local-metadata: Support seasonxepisode format in filenames Okay, this patch adds the test as well. The test fails do to not-completely-related problem, in the example filename I had a minus sign as a separator. Do we want to support this case? I would suggest ignoring " - " (minus with spaces around it). Is that acceptable?
Created attachment 270594 [details] [review] local-metadata: Support seasonxepisode format in filenames Fixed version of the previous patch. I added a regex replacement to replace " - " with "." in filenames, as it is unlikely " - " (space, minus, space) is an actual part of an episode/show/movie name. Tests pass successfully now.
Created attachment 273105 [details] [review] local-metadata: Support seasonxepisode format in filenames seasonxepisode, for example 5x24 is a less common format than S5E24, but it's out there. This commit adds support for this format in filenames.
Attachment 273105 [details] pushed as 9bb477e - local-metadata: Support seasonxepisode format in filenames