NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Media\Show Directory

 
  • 0 Vote(s) - 0 Average
Media\Show Directory
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#1
2010-08-02, 07:41 PM (This post was last modified: 2010-08-03, 01:23 AM by mvallevand.)
Sub, would it be possible to create a PluginHelperFactory() function to normalize filenames for storing to the Media\Show folder. Using this there would be a consistent way to write and look files in the folder?

Some of the things I would like it to do,

- ToLower();
- parse out invalid path and filename characters.
- remove trailing "®"
- TrimEnd(' ');
- Replace(" and ", " & ");

Marti
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#2
2010-08-02, 08:01 PM
This will normalize filenames by removing invalid characters and trimming whitespaces from the start and end:

Code:
private static string FixedFilename(string inString)
        {
            while (inString.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) != -1)
            {
                inString = inString.Remove(inString.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()), 1);
            }
            return inString.Trim();
        }
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#3
2010-08-02, 08:21 PM
Yes, I have something similar, but I was hoping sub could provide something a bit more functional.

Martin
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#4
2010-08-03, 01:03 AM
I really need to just start prefixing my posts with "Workaround" so you can ignore them. Wink
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#5
2010-08-03, 01:21 AM
No it's very good for discussion. I am not even sure if sub support's the Trim() so it's worth getting the points out there so he can correct us (or provide a helper)

Martin
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#6
2013-07-08, 11:42 PM
I'm bumping this thread because I'm not still quite sure what logic is used. A Canadian show "Dragons' Den" appears as "Dragons Den" in NextPVR even though the apostrophe is valid in files and folders.

Martin
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#7
2014-06-29, 03:20 PM
Bumped again almost a year later for the same reason, NextPVR removes the apostrophe in "Under the Dome: Inside Chester's Mill" Sub do you know if there are other valid path/file characters that you exclude?

Martin
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#8
2014-06-29, 06:13 PM
Yea, I noticed that with Marvel's Agents of S.H.I.E.L.D. too.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#9
2014-06-29, 09:30 PM
It's a little difficult for me to check at the moment. I'm out of the country for a couple of weeks.

From memory there is a dozen or so special characters removed from the recording directory name when creating a recording, which ultimately leads to the name it looks for in media\shows. ie %<>|.?*`'\" etc.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,180
Threads: 958
Joined: May 2006
#10
2014-07-01, 01:09 PM
That's a good memory there are three allowed characters `, ', and % and of course the pesky ellipsis which is removed but really just not valid at the os level the end of the directory.

Are you in New York and did you bring us this heat wave? Last winter it was the cold snap.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Artwork by show name psycik 4 4,672 2017-07-12, 03:47 AM
Last Post: psycik
  Looking for C# UPnP Media Server code bgowland 5 7,761 2016-12-16, 08:25 PM
Last Post: mvallevand
  Media Browser Integration lukemb3 557 159,819 2015-11-29, 05:27 PM
Last Post: UncleJohnsBand
  Show artwork method psycik 31 12,278 2015-07-14, 07:06 AM
Last Post: aloxinh
  Media\Shows Metadata mvallevand 2 1,946 2013-05-22, 04:09 AM
Last Post: mvallevand
  sabnzbd plugin to show processed files Wakalaka 1 2,029 2013-03-12, 06:48 AM
Last Post: psycik
  Streaming media imilne 44 13,229 2012-12-14, 04:05 AM
Last Post: mvallevand
  Get NextPVR data directory from outside a plugin McBainUK 3 2,343 2012-02-11, 05:42 PM
Last Post: mvallevand
  Building a list of files in media folders (npvr Music and Videos) bgowland 2 1,958 2012-02-05, 10:29 AM
Last Post: bgowland
  Directory Listings imilne 11 4,482 2011-11-03, 07:48 PM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode