After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725026 - Add support for SeasonxEpisode filename format
Add support for SeasonxEpisode filename format
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-23 23:37 UTC by Elad Alfassa
Modified: 2014-03-27 19:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] local-metadata: Support seasonxepisode format in filenames (1.51 KB, patch)
2014-02-26 22:46 UTC, Elad Alfassa
needs-work Details | Review
local-metadata: Add tests for episode name parsing (6.02 KB, patch)
2014-02-27 12:59 UTC, Bastien Nocera
committed Details | Review
[PATCH] local-metadata: Support seasonxepisode format in filenames (2.15 KB, patch)
2014-02-27 18:45 UTC, Elad Alfassa
none Details | Review
local-metadata: Support seasonxepisode format in filenames (2.63 KB, patch)
2014-02-28 19:58 UTC, Elad Alfassa
none Details | Review
local-metadata: Support seasonxepisode format in filenames (2.68 KB, patch)
2014-03-27 17:36 UTC, Bastien Nocera
committed Details | Review

Description Elad Alfassa 2014-02-23 23:37:55 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.
Comment 1 Elad Alfassa 2014-02-26 22:46:07 UTC
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.
Comment 2 Bastien Nocera 2014-02-27 12:59:59 UTC
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 3 Bastien Nocera 2014-02-27 13:01:37 UTC
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
Comment 4 Bastien Nocera 2014-02-27 13:11:50 UTC
(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).
Comment 5 Bastien Nocera 2014-02-27 13:12:48 UTC
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 :)
Comment 6 Elad Alfassa 2014-02-27 18:45:16 UTC
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?
Comment 7 Elad Alfassa 2014-02-28 19:58:03 UTC
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.
Comment 8 Bastien Nocera 2014-03-27 17:36:28 UTC
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.
Comment 9 Bastien Nocera 2014-03-27 19:22:10 UTC
Attachment 273105 [details] pushed as 9bb477e - local-metadata: Support seasonxepisode format in filenames