NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 29 30 31 32 33 34 Next »
PostProcessing.sh and a ' in Show Name

 
  • 0 Vote(s) - 0 Average
PostProcessing.sh and a ' in Show Name
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,646
Threads: 767
Joined: Nov 2003
#11
2019-10-07, 08:11 PM
(2019-10-06, 02:31 PM)tjzi422xlk Wrote: I did some more testing and it looks like this might be the answer and still preserve the single quote:

bash -c "'/var/opt/nextpvr/scripts/PostProcessing.sh' '/mnt/NextPVR/Recordings/Mister Rogers Neighborhood/Season 15/Mister Rogers Neighborhood.S15E12.ts' 671 2529 21 'Mister Rogers'\'' Neighborhood'" - note, it is single quote,backslash,single quote,single quote after Rogers - it's hard to see.

In my PostProcessing script I echo'd the $1 $2 $3 $4 $5 variables and this is the output:

/mnt/NextPVR/Recordings/Mister Rogers Neighborhood/Season 15/Mister Rogers Neighborhood.S15E12.ts 671 2529 21 Mister Rogers' Neighborhood
I've had another go at this for the next release, replacing 'single quote' characters with 'single quote, backslash, single quote, single quote'. I don't have a convenient show to test it on, but testing it in shell window looks like it'll do the job.
tjzi422xlk
Offline

Junior Member

Posts: 7
Threads: 1
Joined: Oct 2015
#12
2019-10-07, 08:55 PM
(2019-10-07, 08:11 PM)sub Wrote:
(2019-10-06, 02:31 PM)tjzi422xlk Wrote: I did some more testing and it looks like this might be the answer and still preserve the single quote:

bash -c "'/var/opt/nextpvr/scripts/PostProcessing.sh' '/mnt/NextPVR/Recordings/Mister Rogers Neighborhood/Season 15/Mister Rogers Neighborhood.S15E12.ts' 671 2529 21 'Mister Rogers'\'' Neighborhood'" - note, it is single quote,backslash,single quote,single quote after Rogers - it's hard to see.

In my PostProcessing script I echo'd the $1 $2 $3 $4 $5 variables and this is the output:

/mnt/NextPVR/Recordings/Mister Rogers Neighborhood/Season 15/Mister Rogers Neighborhood.S15E12.ts 671 2529 21 Mister Rogers' Neighborhood
I've had another go at this for the next release, replacing 'single quote' characters with 'single quote, backslash, single quote, single quote'. I don't have a convenient show to test it on, but testing it in shell window looks like it'll do the job.



Thanks.  I'll give it a try when available.
tjzi422xlk
Offline

Junior Member

Posts: 7
Threads: 1
Joined: Oct 2015
#13
2019-10-09, 12:54 AM (This post was last modified: 2019-10-09, 01:07 AM by tjzi422xlk.)
I stumbled on to another "special case", this time with a show with an exclamation mark (!) in the show name.
I played around with some various scenarios and it looks like they need to be escaped much like the single quote.

Here is an example:

bash -c "'/var/opt/nextpvr/scripts/PostProcessing.sh' '/mnt/NextPVR/Recordings/Whats Happening'\!''\!'/Season 01/Whats Happening'\!''\!'.S01E18.The Tickets.ts' 674 2588 21 'What'\''s Happening'\!''\!''"

single quote, backslash,!,single quote - '\!'

This is probably a rare occurrence, but someone might run into this.

EDIT: I'm not entirely sure if this is necessary. When I run the bash command from a command shell prompt, there are issues with the exclamation marks, but it might not be a problem when called from the recording process because it recorded with the correct name - the only problem was the single quote when the PostProcessing script was called.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,646
Threads: 767
Joined: Nov 2003
#14
2019-10-09, 01:09 AM
I'm not sure that one is necessary. Did you try recording that show, or this just going by the name?
tjzi422xlk
Offline

Junior Member

Posts: 7
Threads: 1
Joined: Oct 2015
#15
2019-10-09, 01:16 AM
(2019-10-09, 01:09 AM)sub Wrote: I'm not sure that one is necessary. Did you try recording that show, or this just going by the name?

I did record the show and it did save the recording as it it should:

---------
2019-10-07 14:52:52.343 [DEBUG][8] allocating recording target filename: /mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts

2019-10-07 14:52:52.343 [DEBUG][8] About to start recording (2588 on 21): /mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts...

2019-10-07 14:52:52.358 [DEBUG][8] Creating writer: /mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts
2019-10-07 14:52:52.358 [DEBUG][8] Created Mutex: Global\NPVR-mutex-0a6fa77205234cb12381acba14dbd4af
2019-10-07 14:52:52.358 [DEBUG][8] Created map: System.IO.FileStream
2019-10-07 14:52:52.358 [DEBUG][8] StartStream [/mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts] allocated handle: 8
2019-10-07 14:52:52.358 [DEBUG][8] StartStream() returned handle=8
2019-10-07 14:52:52.358 [DEBUG][8] Allocated Handle: 8
2019-10-07 14:52:52.358 [DEBUG][8] Started recording (2588:8:/mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts)

2019-10-07 15:00:00.534 [DEBUG][8] Starting: bash -c "'/var/opt/nextpvr/scripts/PostProcessing.sh' '/mnt/NextPVR/Recordings/Whats Happening!!/Season 01/Whats Happening!!.S01E18.The Tickets.ts' 674 2588 21 $'What's Happening!!'"
2019-10-07 15:00:00.546 [ERROR][48] bash: -c: line 0: unexpected EOF while looking for matching `''
2019-10-07 15:00:00.546 [ERROR][48] bash: -c: line 1: syntax error: unexpected end of file
-----

Looking at it now, I think it probably will work fine.  I know there are some quirks with the exclamation mark and those might have been unique to calling the bash script from a command prompt.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,646
Threads: 767
Joined: Nov 2003
#16
2019-10-09, 01:27 AM
Usually if a simple echo works for me, it'll work when NextPVR calls it:

Code:
[root@s152252 ~]# echo 'What'\''s Happening!!'
What's Happening!!
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,810
Threads: 954
Joined: May 2006
#17
2019-10-09, 01:41 AM
The example with the exclamation mark also has the single quote so not the best test. It's not clear why a string replace with \\' doesn't work with .net though.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  One show 'interrupted' twice SteveCos 0 173 2025-02-11, 09:03 AM
Last Post: SteveCos
  Attachments don't show up in posts. WagMan 2 222 2024-11-02, 04:32 AM
Last Post: WagMan
  Folder location PostProcessing.sh with LibreElec retrofan 10 1,103 2024-08-14, 04:44 PM
Last Post: retrofan
  Can't record series for certain show WagMan 9 1,312 2024-08-07, 01:34 AM
Last Post: mminehan
  Failed recording for a particular show spagio 9 1,409 2023-01-12, 12:46 AM
Last Post: mvallevand
  TV Show recording broken into multiple files markosjal 2 917 2022-07-09, 04:53 AM
Last Post: markosjal
  Fixed? - PostProcessing - NScriptHelper.dll rename failed following 5.2.1 upgrade lostboy 9 2,078 2021-10-26, 05:42 PM
Last Post: sub
  PostProcessing help VCR58 4 1,497 2021-08-31, 04:36 PM
Last Post: pkscout
  Download of recorded show fails (due to å?) ukmoose 2 1,086 2021-03-01, 10:44 AM
Last Post: ukmoose
  Rewind recorded show VCR58 2 1,210 2020-04-23, 04:26 AM
Last Post: VCR58

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

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

Linear Mode
Threaded Mode