![]() |
|
Register | Forum Rules | FAQs | Members List | Social Groups | Downloads | Search | Today's Posts | Mark Forums Read |
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Where does Sage build the recording file name?
I touched on this in another thread but I didn't want to hijack it further. As my first exercise with the source code I thought I would change the recording file name to not remove spaces and other characters (ex. the periods in Agents of S.H.I.E.L.D). I can find where a file name is passed in to be written but the code that "scrubs" the name eludes me
![]() |
#2
|
|||
|
|||
ADD Kicking in why oh why would you want periods in a title? Many scrapers see that as spaces and seems it would mess things up a bit.
As for parsing out I haven't looked for that in the code but shouldn't be hard guessing they are creating any time a channel is tuned or a recording starts. |
#3
|
|||
|
|||
Looks like maybe line 4249 in MediaFile.java?
"public static String createValidFilename(String tryMe)" |
#4
|
|||
|
|||
Quote:
|
#5
|
||||
|
||||
Having periods in the strings you are searching FOR has nothing to do with affecting the regex you are using to search for them, if the regex is built correctly. In any case, the region of MediaFile.java is where the names are generated. I can see a use for making a 'custom' naming scheme property entry to enable you to alter the default that sage uses - I also, on current systems, so no reason to exclude spaces and some special characters anymore either (except characters that can't exist in filenames, like drive and path separators).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#6
|
||||
|
||||
Thanks for the help. I'll take a look at that section.
|
#7
|
|||
|
|||
Keep in mind that sage metadata on season and episode number are not always correct in my finding. It's why I decided to name after BMT gets data.
|
#8
|
||||
|
||||
OK I have made my change to bypass the string editing if the property 'keep_original_filenames' is set to true in the Sage.properties file. A quick test did create a valid filename with spaces, etc. that played fine in Placeshifter in Windows 10 (woot, my first contribution to an open source project
![]() For anyone interested, my repository is https://github.com/atarijeff/sagetv |
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
Quote:
I think a better approach might be to build a whitelist of characters, in addition to the list that Sage is checking (ie, letters and numbers), and this whitelist would need to be different for linux and windows.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#11
|
||||
|
||||
Quote:
Perhaps a better name is in order. |
#12
|
|||
|
|||
I think the name is ok. Didn't you add a new variable? That means the properties file would not have it defined and therefore should be false to not cause the early return if not defined.
|
#13
|
||||
|
||||
Quote:
|
#14
|
||||
|
||||
Correct. The intention was to retain SageTV's original naming scheme unless the user wanted to turn on the feature specifically. Now that I think of it I should probably get the new variable added to the default properties file somewhere.
|
#15
|
|||
|
|||
Quote:
All you need to do is use ", false" in the getBoolean function. I'm pretty sure that's the return value if not defined. Edit: looks like that's the value when the preferences aren't valid. Will check into what happens if undefined. Edit2: yes, undefined uses the 2nd argument as the default. Last edited by wnjj; 10-02-2015 at 10:07 AM. |
#16
|
||||
|
||||
Quote:
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#17
|
||||
|
||||
Which is not reflected in the Sage.properties until sage does a "save"... which is usually just before it shuts down.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#18
|
||||
|
||||
It saves that file every 5 minutes worst case if it has changes (part of the Seeker's loop); there's many other operations that cause it to be saved immediately.
__________________
Jeffrey Kardatzke Founder of SageTV |
#19
|
||||
|
||||
I have updated my branch to exclude characters in the file name that Windows does not like. I'm on a Linux system but I'd like the logic to work universally. I won't know until a few days when SageTV tries to record a show called 'LOL :-)' and see a) if it works, and b) what Kodi does with it.
|
#20
|
|||
|
|||
Quote:
Last edited by wnjj; 10-02-2015 at 12:31 PM. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New API build to fix .properties file issue | PLUCKYHD | Sage My Movies | 2 | 01-22-2011 08:02 AM |
Does SageTV create a zero length recording file before recording starts? | michaeldjcox | SageTV Linux | 6 | 10-18-2010 06:03 AM |
mpg video file Sage thinks is an audio file | kmp14 | SageTV Software | 1 | 03-14-2010 08:01 PM |