damienhaynes / moving-pictures

Moving Pictures is a movies plug-in for the MediaPortal media center application. The goal of the plug-in is to create a very focused and refined experience that requires minimal user interaction. The plug-in emphasizes usability and ease of use in managing a movie collection consisting of ripped DVDs, and movies reencoded in common video formats supported by MediaPortal.
12 stars 6 forks source link

Multi-Part pattern problem on certain filenames (with solution included) #796

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current multi-part RegExp fails on the following filenames:

 - Invictus.CD1.PROPER.DVDSCR.XviD-FOXNEWS.avi
 - Case.39.CD1.DVDSCREENER.XviD-MENTiON.avi

It fails on two parts, first it sees DVDSCR as DVD 'S' for multipart, 
which makes noise filter fail later on. This is fixed by forcing a check 
on the next character to be a closing bracket type, or a space/dot.

But the existing code also picks up ".CD1." (correctly) for the multipart 
identification, and then strips it from the filename. This then results in 
a title "InvictusPROPER" and "Case 39DVDSCREENER" because the seperation 
is killed in those cases, which messes up the Noise Filter.

Solution for: http://code.google.com/p/moving-
pictures/source/browse/trunk/MovingPictures/LocalMediaManagement/Utility.cs
#61

Is to use:

         private const string rxFileStackPattern = @"(\b(cd|dvd|dis[ck]
|part)\W*([a-z](?=[\]\)\}\s\.])|\d+|i+)\W*)|\W\d+\W*(of|-)\W*\d+\W$";
         private const string rxFolderStackPattern = @"^(cd|dvd|dis[ck]
|part)\W*([a-z](?=[\]\)\}\s\.])|\d+|i+)$";

Note: Removing the "\W*" part of the start on the fileStack pattern was 
needed to avoid the tile corruption, so it only removes "CD1." string from 
the examples.

Original issue reported on code.google.com by RoChess....@gmail.com on 10 Mar 2010 at 11:44

GoogleCodeExporter commented 9 years ago
from the original expression \W* should be changed to (\W|$) and the method 
that 
does the replace should replace with an empty space. Leading, trailing and 
double 
spaces would get removed from the final output so that would be a more simple 
approach

Original comment by apond...@gmail.com on 11 Mar 2010 at 9:57

GoogleCodeExporter commented 9 years ago
Thanks, I'm still not good at the proper syntax, as there are multiple ways to 
get 
the same results. But your way is definatly a better guarantee that nothing 
else 
will break.

Original comment by RoChess....@gmail.com on 11 Mar 2010 at 10:39

GoogleCodeExporter commented 9 years ago
Has this been integrated? If not lets schedule this for 1.1.

Original comment by conrad.john on 30 May 2010 at 11:05

GoogleCodeExporter commented 9 years ago

Original comment by conrad.john on 30 May 2010 at 11:20

GoogleCodeExporter commented 9 years ago
sorry this was fixed as part of r1087

Original comment by apond...@gmail.com on 31 May 2010 at 9:21

GoogleCodeExporter commented 9 years ago
function here still needs replace by one space + double spaces trimmer and 
normal trim

http://code.google.com/p/moving-pictures/source/browse/trunk/MovingPictures/Loca
lMediaManagement/Utility.cs#94

Original comment by apond...@gmail.com on 22 Jun 2010 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by apond...@gmail.com on 22 Jun 2010 at 10:39

GoogleCodeExporter commented 9 years ago
The core of the problem is the lack of the '(?=[\]\)\}\s\.])' in both file and 
folder pattern. This was the main contributing part, to ensure it would only 
match DVD1. and DVDa. and DVD2] type of patterns, so that DVDSCR is not seen as 
a part.

This was not fixed in r1087

Original comment by RoChess....@gmail.com on 22 Jun 2010 at 10:47

GoogleCodeExporter commented 9 years ago
no really the effect of the part not being properly replaced (with a space) is 
that DVDSCREENER is not removed also so that's the core of the problem

Original comment by apond...@gmail.com on 22 Jun 2010 at 11:25

GoogleCodeExporter commented 9 years ago
apondman is right, just tested with the modified replace + double space trim 
and normal trim

http://img139.imageshack.us/img139/1939/testimport.jpg

Original comment by mitja.skuver on 22 Jun 2010 at 11:50

GoogleCodeExporter commented 9 years ago
ok done

Original comment by apond...@gmail.com on 23 Jun 2010 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by conrad.john on 31 Jan 2011 at 12:53