New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psxc-imdb plot #28

Open
silv3rr opened this Issue Dec 27, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@silv3rr
Contributor

silv3rr commented Dec 27, 2017

PLOT="Plot: $(sed -n '/^ Plot Summary$/,/^ \* Plot Summary$/p' "$TMPFILE" | sed -n 'n;p' | sed s/\"/$QUOTECHAR/g | sed 's/^\ *//g' | tr -s ' ' | sed "s/ *$//")"

Seems there are 2 issues with "Plot":

  • as "*" char is not escaped it lists files in current dir in $PLOT
  • no linebreaks on long lines / handling multiple plot lines

Possible fix:

PLOT="Plot: "$(sed -n '/^ Plot Summary$/,/^ \* Plot Summary$/{//d;p;}' "$TMPFILE" | sed s/\"/$QUOTECHAR/g | sed 's/^\ *//g' | tr -s ' ' | sed "s/ *$//" | fold -s -w 275 | sed ':a;N;$!ba;s/\n/\\\\n/g')""

This removes " * Plot Summary" and uses fold/sed to break lines

@silv3rr

This comment has been minimized.

Contributor

silv3rr commented Jan 1, 2018

Addition:

  • it's better to set fold -w to a lower value like 275, specially if you're using blowfish encryption (= longer lines)
  • also, to remove the extra newlines from dotimdb files change:

echo "$PLOT" | fold -s -w $IMDBWIDTH >> "$IMDBLNK"

to:

echo "$PLOT" | sed 's/\\\\n//g' | fold -s -w $IMDBWIDTH >> "$IMDBLNK"
@i137

This comment has been minimized.

i137 commented Jan 12, 2018

Thanks @silv3rr, that fixes the unwanted file listing. Make a pull request?

@silv3rr

This comment has been minimized.

Contributor

silv3rr commented Jan 12, 2018

@i137 there will be but i have a few more local changes to commit first e.g. to remove "Written by":

PLOT="Plot: $(sed -n '/^ Plot Summary$/,/^ \* Plot Summary$/p' "$TMPFILE" | sed -n 'n;p' | sed s/\"/$QUOTECHAR/g | sed 's/^\ *//g' | tr -s ' ' | sed "s/ *$//")"

change to:

PLOT="Plot: "$(sed -n '/^ Plot Summary$/,/^ \* Plot Summary$/{//d;p;}' "$TMPFILE" | sed 's/Written by .*$//' | sed s/\"/$QUOTECHAR/g | sed 's/^\ *//g' | tr -s ' ' | sed "s/ *$//" | fold -s -w 275 | sed ':a;N;$!ba;s/\n/\\\\n/g')""

Also testing using boxofficemojo for "screens" but needs better matching imdb tt <-> title on BOM. Plus few other small tidbits (improve folding and add width as variable in conf, replace \\n by $NEWLINE etc).

silv3rr added a commit to silv3rr/pzs-ng that referenced this issue Feb 6, 2018

silv3rr added a commit to silv3rr/pzs-ng that referenced this issue Mar 5, 2018

silv3rr added a commit to silv3rr/pzs-ng that referenced this issue Mar 5, 2018

silv3rr added a commit to silv3rr/pzs-ng that referenced this issue Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment