home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
General
this view could not be built
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MJGraf" data-source="post: 1164686" data-attributes="member: 17886"><p>As to the matching based on movie name, I have found at least one movie name that currently doesn't work.</p><p>We use a regular expression on the full path of a movie file to match movie title and year. The regular expression we use is:</p><p>[CODE](?<title>[^\\|\/]*?)\s*[\[\(]?(?<year>(19|20)\d{2})[\]\)]?[\.|\\|\/]*[/CODE]</p><p>If you apply this to the following path:</p><p>[CODE]\\BOOMER\Movies\#\1911 (2011)\abd-1911-1080p.mkv[/CODE]</p><p>(which you can test online here: <a href="https://regex101.com/" target="_blank">https://regex101.com/</a> )</p><p>you can see that the movie name match is empty. This is because the title part : "[^\\|\/]*?)" is "lazy" and accepts zero characters. I first thought about making it "greedy" instead of "lazy", but I suppose this is intentionally made "lazy" so that if there are two four-digit numbers starting with 19 or 20, we don't have any of them in the title and only the first one in the year.</p><p>But admitting zero character titles doesn't make sense to me. If we replace "*?" with "+?" so that the title must have at least one character, the path above matches correctly. Regular Expression would then look like:</p><p>[CODE](?<title>[^\\|\/]+?)\s*[\[\(]?(?<year>(19|20)\d{2})[\]\)]?[\.|\\|\/]*[/CODE]</p><p>[USER=48495]@morpheus_xx[/USER] : Any thoughts?</p></blockquote><p></p>
[QUOTE="MJGraf, post: 1164686, member: 17886"] As to the matching based on movie name, I have found at least one movie name that currently doesn't work. We use a regular expression on the full path of a movie file to match movie title and year. The regular expression we use is: [CODE](?<title>[^\\|\/]*?)\s*[\[\(]?(?<year>(19|20)\d{2})[\]\)]?[\.|\\|\/]*[/CODE] If you apply this to the following path: [CODE]\\BOOMER\Movies\#\1911 (2011)\abd-1911-1080p.mkv[/CODE] (which you can test online here: [URL]https://regex101.com/[/URL] ) you can see that the movie name match is empty. This is because the title part : "[^\\|\/]*?)" is "lazy" and accepts zero characters. I first thought about making it "greedy" instead of "lazy", but I suppose this is intentionally made "lazy" so that if there are two four-digit numbers starting with 19 or 20, we don't have any of them in the title and only the first one in the year. But admitting zero character titles doesn't make sense to me. If we replace "*?" with "+?" so that the title must have at least one character, the path above matches correctly. Regular Expression would then look like: [CODE](?<title>[^\\|\/]+?)\s*[\[\(]?(?<year>(19|20)\d{2})[\]\)]?[\.|\\|\/]*[/CODE] [USER=48495]@morpheus_xx[/USER] : Any thoughts? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
General
this view could not be built
Contact us
RSS
Top
Bottom