#Plex-Poster-Maker (ppm) Stuff

1 messages ยท Page 2 of 1

fresh gorge
#

if I add movies... the numbers get even more difficult to follow

#

For the logs to be useful, and the summary to be helpful, I need to be able to find where things went wrong and fix them

#

Thats the perspective I am coming from

#

And where most users will come from

#

If I want to know how many times a movie poster did not come from my primary source, that should be easy to find.

#

So taking a step back, based on the summary (We don't need answers in the summary, but the knowledge to search for key strings to find the answer):
1 - Did text get truncated? If so, which posters?
2 - Did a poster come from my primary source or not? If not, which ones?
3 - If the selected poster has text on it, which ones?
4 - If the season poster was "copied" from the show poster, which ones?
5 - If the API produced some kind of error, which ones?

proud seal
#

I know, thats why a logfile is present and the infos are in logfile?

fresh gorge
#

I understand.... and I provided you my log file because I cannet find what the "2" represents

#

your reply was look for poster with text

#

i did and came up with 153

#

so now what?

#

I need to review 153 sections to find the two?

proud seal
#

As an example, what are you missing here?

[2024-02-25 10:33:56] TRACE   |      Searching on TMDB for a Season poster
[2024-02-25 10:33:56] OPTIONAL|      Found Poster with text on TMDB
[2024-02-25 10:33:56] DEBUG   |      Taking TMDB Fallback show Poster for - Season01...
[2024-02-25 10:33:56] INFO    |      Poster url: https://image.tmdb.org/t/p/original/yscwTJzKeOID3djzy78UONxmwOe.jpg
[2024-02-25 10:33:56] DEBUG   |      Downloading Poster from 'TMDB'
[2024-02-25 10:33:56] INFO    |      Resizing it | Adding Borders | Adding Overlay
[2024-02-25 10:33:58] INFO    |      Optimal font size set to: '150'
[2024-02-25 10:33:58] INFO    |      Applying Font text: "SEASON 1"
[2024-02-25 10:33:59] TRACE   |      Searching on TMDB for a Season poster
[2024-02-25 10:33:59] OPTIONAL|      Found Poster with text on TMDB
[2024-02-25 10:33:59] DEBUG   |      Taking TMDB Fallback show Poster for - Season02...
[2024-02-25 10:33:59] INFO    |      Poster url: https://image.tmdb.org/t/p/original/yscwTJzKeOID3djzy78UONxmwOe.jpg
[2024-02-25 10:33:59] DEBUG   |      Downloading Poster from 'TMDB'
[2024-02-25 10:33:59] INFO    |      Resizing it | Adding Borders | Adding Overlay
[2024-02-25 10:34:00] INFO    |      Optimal font size set to: '150'
[2024-02-25 10:34:00] INFO    |      Applying Font text: "SEASON 2"```
fresh gorge
#

let me read this a couple of times.

#

these lines could be clearer:
Found Poster with text on TMDB
Taking TMDB Fallback show Poster for - Season01...

Based on this section, I would say that the counter for fallback is incremented by 1 (perseason), the number for poster with text (may or may not) be incremented by 1(per season)

#

maybe Fallback show Poster is a good string to search on to find the number of times a season postere was used based on the show poster?

#

I also have only 1 occurrence of Fallback poster cause its your Fav Provider which seens to be an interesting line

#

Shouldn't that be false?

#

or maybe I am misunderstanding... which is more likely

#

texlessposter and posterwithtext should be opposed?

#

when one is true, the other is false?

#

$global:TextlessPoster = $false
$global:PosterWithText = $true

#

Not sure I understand why we have both of these in the script

fresh gorge
#

How would you handle the following with this script?

#

imdb is invalid

#

tmdb does not exist

#

fanart gives poster with text

#

tvdb seems to have some posters

#

I made this...

#

no idea where I would put this to possibly have the script apply the overlay, border, and text

#

trying to add it to fanart, but they will likely reject it as they always do

#

added it to tvdb: https://thetvdb.com/series/looney-tunes#artwork as an image with no text, but again, I think that the script does not try to download tvdb textless images. Their image upload workflow allows one to choose a picture without text

proud seal
#

I would say, choose a provider you want to stick with and add there the files that are missing, it does make the script to complex if you have to search there and there and only take this when this is not present and and and...

fresh gorge
#

Absolutely. Unfortunately. Tmdb rejected looney tunes as its evolved since 1929 so they don't recognize it.

#

The csv does not have a tmdb id

proud seal
#

if its missing in csv, its missing in plex

#

But try latest, i added tvdb textless search and im now exporting every info to a csv into the logs folder "PosterChoices.csv" i think you now can better find what needs manual work...

fresh gorge
#

sure. let me try

fresh gorge
#

LibraryName column is always empty... just FYI

#

148 records in csv where fallback=TRUE

#

142 in summary

fresh gorge
#

that being said, the csv is very useful. I am setting it to false on that column and going to fix the sources in TMDB

proud seal
#

Both should be fixed.

fresh gorge
# proud seal Both should be fixed.

Oh no.... this version is worse in terms of results. It's not taking any textless season posters. It is falling back to the show poster all the time, even if it reports that it found the textless season poster.

#

And this can't be right... well it sort of is right and wrong all at the same time.

proud seal
#

had a type, fixed ๐Ÿ˜„

#

i need to make another textlib, during testing before pushing it, my libs never act like this

fresh gorge
#

How could my libs be so different?

#

Are the shows I watch that obscure?

proud seal
#

i dunno, everytime you have a problem i dont have i try to add exactly that show to get the same result ๐Ÿ˜„ i even changed on one testlib to use season title and tmdb, cause i do not had it that way

fresh gorge
#

Ok. I am rerunning with the latest version. So far it looks like that typo fixed the issue.

#

Much better. I will need to review because it says everything is textless but I still see text on posters so I will need to go see the source and find out what is happening

fresh gorge
#

Prison Break, Planet Earth, Looney Tunes, Impractical Jokers all have text posters/season scattered. Likely a bad source but will require me to investigate each one. Been creating textless posters for the last 4 days....

proud seal
#

we need a free ai api tool for that, that detects text and then removes it ๐Ÿ˜„

fresh gorge
#

well... here is the next bug

#

according to the csv, textless is true, but there are no textless on tmdb

#

both season and show have text. This should have done a fallback to another provider

#
[2024-02-26 07:41:11] TRACE   |      Searching on TMDB for a show poster
[2024-02-26 07:41:11] OPTIONAL|      Found Poster with text on TMDB
[2024-02-26 07:41:11] INFO    |      Poster url: https://image.tmdb.org/t/p/original/mfXulHiALTloIqivuC4Q3lI3RGw.jpg
[2024-02-26 07:41:11] DEBUG   |      Downloading Textless Poster from 'TMDB'
[2024-02-26 07:41:11] INFO    |      Resizing it... 
[2024-02-26 07:41:12] INFO    |      --------------------------------------------------------------------------------
[2024-02-26 07:41:12] INFO    | Start Season Poster Search for: Planet Earth
[2024-02-26 07:41:12] TRACE   |      Searching on TMDB for a Season poster
[2024-02-26 07:41:12] SUCCESS |      Found Textless Poster on TMDB
[2024-02-26 07:41:12] INFO    |      Poster url: https://image.tmdb.org/t/p/original/cx8v8gEJMNBHiXRvRktY3Bm8xR6.jpg
[2024-02-26 07:41:12] DEBUG   |      Downloading Poster from 'TMDB'
[2024-02-26 07:41:12] INFO    |      Resizing it... 
proud seal
#

can you send me the csv entry of libexport from this show?

fresh gorge
#

I will share logs now

#

i wonder if this condition happens when the show poster has text, but the season poster is textless?

#

in the above image, the season poster had text on it because someone classified it as "no language"

#

however, the actual show poster has 0 "No language" posters... so just a theory at this point...

proud seal
#

the api returns textless on those for the show ๐Ÿ˜„

fresh gorge
#

I deleted the 1 show poster and ran script:

#

Found poster with text

#

downloading textless poster

#

it either found it with text, or it didn't?

#

Like I mentioned.... the condition here might be that if sesaon has textless but show only has text

#

planet earth show has TEXTONLY, but the seasons contain images that are textless.

#

csv says all textless

#

site does not have textless show and no textless season

#

the logs I shared have all this in there as well

#

Money Heist is going to be a special review... so I will hold off on that one....

#

Looney Tunes show poster is with text. yet csv says textless. notice how its pulling from fanart, yet the fallback says false? To me that means that it grabbed from my primary which is tmdb

#

and from fanart:

#

has text on it... and labelled as having text.

#

Impractical Jokers:
Show poster is textless.
Season posters are with text:

#

notice how all the results are showing textless true

#

for impractical.. the source is bad.

#

someone uploaded a bunch of posters and did not classify them as english

#

So I cleaned up the season posters and labelled them all as english. so now in theory, for impractical jokers, whenever the API has the updates, only the show poster is textless.... none of the season posters are textless. (I would need to create them and upload them)

proud seal
#

those all text and texless issues drive me crazy ๐Ÿ˜„
please try latest, in my test the planet earth now reported back exactly like the api does, so it should now also report back the way in scriptlog and in csv.

fresh gorge
#

You telling me?!? Crazy is my middle name... lol.

#

I will test it out shortly.

fresh gorge
#

So I think this last version, for Looney Tunes, is grabbing the textless version from tvdb after not finding anything on primary with tmdb, and finding a poster with text on fanart. (This is a good result) Rerunning to look for other anomalies

#

so not much of a conclusion... since I cannot tell when the API updates are completed for tmdb.... right now, the script should come back empty on all seasons for impractical jokers.... as I had to label all of them as english

#

as for the 2 planet earth 1 and 2, I am not sure how to interpret the csv:

#

textless FALSE, fallback True

#

the log explains pretty much why its text, but since I ended up grabbing from tmdb, why is fallback true?

#

as for the seasons in Planet Earth / Planet Earth II, I think its a question of waiting again as I may have done some cleanup in tmdb and need that to reflect in the API

proud seal
#

Fallback is true because it tried to search on other sites too, but only with text available so it took the fallback poster from fav provider, in this case tmdb

fresh gorge
#

which is the preferred... so fallback switches to true if ever in the logic, it goes to something other than the primary

proud seal
#

Correct

fresh gorge
#

OK. I can live with that now that the "business" logic is explained

#

lunch time for me. gonna try after lunch without making any changes to tmdb to see if the API is updated yet.

fresh gorge
#

on a separate note.. I am 2 for 2 on having art rejected from fanart.tv.

#

I dont hink I will be submitting much to them

#

anymore... lol

proud seal
#

๐Ÿฅฒ thats sad, back in the days of kodi, fanart was the way to go

fresh gorge
#

They are so picky. like the Looney Tunes is from 1929... and they are worried about the quality of the image... its kind of embarrassing

fresh gorge
#

OK. so API updates happened and the script is looking accurate in terms of results

#

shows 1 text image and when I use my own eyes, there is only 1 text image for planet earth

proud seal
#

Finally ๐Ÿ˜ฎโ€๐Ÿ’จ๐Ÿ˜‚

fresh gorge
#

Yes... now I am pushing up the rest of the fixes to tmdb... then its a waiting game again

fresh gorge
#

so the last strange one. Money Heist...

#

Money Hesit is one of those shows where originally, I think the spanish version only had 3 seasons, but when Netflix released it, they had 5 seasons. So I cannot tell what the script is doing, or where its trying to get the images from.

#

I have the Netflix 5 season version

#

so 5 posters are pulled, but teh last two or three are seemingly duplicates

#

or fallbacks, but not 100% sure why

#

seems that it takes this textless image and makes it the default image for season 4 and season 5.

proud seal
#

Okey, Updated the order on when what gets picked (it has defaulted to fallback on the beginning because it had a texless one as fallback)
Also log adjusted it should be clear now!

rare tulip
#

Good morning guys... Just wanted to take a second here to say you both are Badasses and Thanks! FSCorrupt worked with me to get the postermaker working and I've just been here lurking and downloading the latest updates. I run a software development platform and wish some of my guys were as on it as you are ๐Ÿคฃ Thanks again.

proud seal
fresh gorge
#

I will test with latest version.

fresh gorge
# proud seal Thank you for the appreciation! <:minecraftheart:927954218046861364>

We may want to adjust the readme a little.

I only use pwsh 7.1 and it works fine
Given that this script really tries to grab textless posters above all, I think that should be specified in the first paragraph. If people want the most popular poster regardless of language, this script is not for them.

I am not sure what manual mode will do in this script. I need to try it. What I read sounds like I can decide on having a local poster that I point the script to and it will overlay it and add text. But what if my options don't want that... will it just resize and rename and place into an assets directory?

proud seal
#

but it takes a image, and then moves it and it currently only does one part, so either season poster or show/movie poster, not a lot of logic in manual mode in current state

fresh gorge
#

Here is an enhancement that you might want to consider....

Within the config.json, pick your preferred language for a poster. If you want French, use fr. If you want textless, use xx. If you want German, use de. Thoughts on such a feature?

fresh gorge
#

I think the api calls are already filtering on 3 languages

proud seal
fresh gorge
#

What if you could pass that string to the script

#

Ok. No problem. Not asking for a rewrite

proud seal
#

to prefer posters in specified language even if textless is true or not or?

fresh gorge
#

Ultimately, it would have been cool to specify the language of the posters you wanted as a config option

#

If I want textless with the script, I pass xx

#

If I want German, de

#

If I want French, fr

#

So the user decides what language they want. There is nothing out there like that...

proud seal
#

hmm in theory possible, but i do not know if it breaks the flow ๐Ÿ˜„

fresh gorge
#

For me personally. I want xx, en

#

Others might want en, xx

#

Second is I want English posters, if none exist, give me textless

#

First is that I want textless, and if does not exist, give me English

#

Also, readme show document the new csv that is created as its useful.

proud seal
fresh gorge
#

Oh I see it now... in a sub bullet

fresh gorge
#

Summary and not Summery

#

Also, this summary is new... and wondering why the 72 "errors"

#

Is it because a fallback happened?

#

But fallback shows 75

#

So 72 of the 75 had errors?

#

Let me review the logs

#

Just noticed that 72 looney tunes did not download or have a proper link.

#

Let me rerun.

#

It also explains why this run only took 7 minutes instead of the typical 9

#

Looks like rerunning is now capturing the missing looney tunes

proud seal
modern pebble
#

I just found this yesterday and was checking it out and this is FANTASTIC! Just wondering if there is a way to limit the right side margin as the ribbon overlay in the right lower corner does cut off some of the title text in certain situations. Kudos to you guys, this is really slick!

proud seal
#

Do you have an example pic?

modern pebble
proud seal
#

You need to play with those settings in config file:

    "MaxHeight": "600",
    "text_offset": "+300"```
#

But to only shift the width more from right to left is not possible in current state,

modern pebble
#

So if I took 360 pixels out of the MaxWidth, it would center the text slightly off to the left side (like from the bottom of the ribbon to the left border of the image?) Maybe I'll switch the rating and the ribbon and see how that works out. Thanks!

proud seal
#

The textbox field gets centered and has a maxwidth what you can set in config, if you lower the value it will still center the text inside thte box but you will shift in your case 180px from left to center and 180px from right to center with the text box field.

modern pebble
#

So being the ribbon is 351 pixels, I'd have to double that (702) so the text box doesn't go into the ribbon space? And it would take 351 pixels from both left and right side leaving the width at 1098? Just making sure I understand the concept.

proud seal
#

In current state of script - yes
I can check tomorow if i can add a way to change it like you want to only shift from right to left, not sure if its possible that way

modern pebble
proud seal
#

It has no pmm integration, so i do not know what happens to picture after the creation of mine script

modern pebble
#

Looking at my math above, I guess it would still be centered but it would be a narrower window and have multiple lines of text in it. That won't really look great either. Great job on this though!

proud seal
#

An alternative would be to apply the banner in top left corner and the top parts to the bot

modern pebble
#

Yes, I'm moving the ribbon to top left and the rating to bottom right. That should look good. Thanks again!

fresh gorge
#

Try to imagine a box that this script will place text into. And the base image is 2000x3000

#

It will optimize the font size based on the box size

#

It will add the carriage returns as needed and based on your font as not all fonts are the same

modern pebble
fresh gorge
#

It's a box so height plays into this as well

#

If you don't want it to go so high, limit the box height as well

modern pebble
fresh gorge
#

Max font size tells it never to go larger than a certain font size and min font does the same

rare tulip
#

Spent a lot of time making sure all my PMM items don't cover any of the awesome poster work you guys are doing ๐Ÿ™‚

modern pebble
modern pebble
fresh gorge
#

Hence min font size

#

You need to fool around until you find the right box and then the min and max font for that box and the font you want. Also planning where the other overlays go

#

You can also choose to exclude border if you want

modern pebble
fresh gorge
#

Just sharing how the script is very flexible... and you need to conceptualise a couple of items and plan things out for it to work out.

#

I love that it grabs textless posters, assuming they are available and marked properly in the source systems

fresh gorge
#

You could also decide to have the title at the top with the overlay from the top down. You'd need to flip the overlay.png and then adjust the text box offset to be at the top, so that's doable as well.

#

Not sure the posters would look good that way as likely covers people in the poster compared to covering their lower body

modern pebble
#

LOL I didn't even think about the shape of the ribbon overlay!

fresh gorge
#

Since I am overlay crazy. I just want the textless posters

proud seal
#

Yeah you would need to create a new ribbon template for left top and apply this instead of the default one ๐Ÿ˜…

fresh gorge
#

This is also why I prefer to have pure textless and 0 border, and text applied....

#

For me personally it gives me the most freedom.

modern pebble
fresh gorge
#

0 means that the "box" is at the bottom

#

1 means the box is 1px off the bottom edge

#

100px means that it is 100px from bottom edge

#

I think it's a little more complicated than that, but that was the intention when we built that part

modern pebble
#

So the default config is a box starting at 600px from the bottom edge and the text starts at 300px from the bottom edge (so the text starts centered in the box).

fresh gorge
#

Default?

#

Oh wait...

modern pebble
#

MaxHeight: 600, text_offset: +300

#

Or is that the max height of the overlay image?

fresh gorge
#
    "MaxHeight": "600",
    "text_offset": "+300"
#

So think of the box being 1800x600

#

And the box is pushed up 300px from the bottom

#

Then take your font with the text and it will be centered in that box

#

In theory, and we'd need to check, those variables should probably be renamed to:

    "BoxHeight": "600",
    "box_offset": "+300"
#

That might provide more clarity

modern pebble
#

Probably, or change them to "TextBoxWidth", "TextBoxHeight", and "text_offset", since you're not offsetting the box.

#

But if I change the box width and border width, I assume I need to grab all the posters again (and delete the existing ones?)

fresh gorge
#

I think we are offsetting the box. The text then gets centered within the box

#

Centered horizontally and vertically

proud seal
#

Or read the readme ๐Ÿคญ

modern pebble
#

or that... LOL

fresh gorge
#

Readme?

#

lol who reads that?

modern pebble
#

I gave it a quick perusal

#

Who's the better provider for posters? Fanart or TMDB? Or does it really matter? I did a partial run yesterday and I think I liked the fanart stuff better so I set that as the fav provider.

fresh gorge
#

Tmdb

proud seal
#

I have set it to tmdb, but do what you like more, it will fallback to tmdb if textless not available on fanart

fresh gorge
#

In the long run tmdb is way more flexible

#

If you want to contribute to textless art, tmdb is the way to go

#

If you don't mind that sometimes people upload text art to tmdb and forget to classify it and then you end up with art and text on it, tmdb

#

You can easily go and move that art with text to the right language and then the script won't end up with false positives

fresh gorge
#


magick.exe -size 2000x3000 xc:white -gravity south -background None ( -background lightblue -fill blue -font ""C:\\Users\\bullmoose20\\PosterMaker\\temp\\Comfortaa-Medium.ttf"" -pointsize 210 -size 1090x500 -gravity south caption:"ALEX RIDER" ) -geometry +0+300 -composite output_image.png

To help illustrate the box and height and width and offset

The box size I chose was 1090x500 and the offset from bottom was 300

First command will determine the optimal size based on font and size of box. The size found in my setup is 210 for ALEX RIDER. The second command takes that point size and places the text on the image

#

This can then help you decide which overlays and whether the ribbon and other overlays fit.

#

@modern pebble @rare tulip uparrow

#

magick.exe -size 1800x600 -font "C:\\Users\\bullmoose20\\PosterMaker\\temp\\Comfortaa-Medium.ttf" -gravity center -fill black caption:"ALEX RIDER" -format "%[caption:pointsize]" info:
Gives me 297

#

magick.exe -size 2000x3000 xc:white -gravity south -background None ( -background lightblue -fill blue -font ""C:\\Users\\bullmoose20\\PosterMaker\\temp\\Comfortaa-Medium.ttf"" -pointsize 297 -size 1800x600 -gravity south caption:"ALEX RIDER" ) -geometry +0+300 -composite output_image2.png

fresh gorge
#

@proud seal we may want to consider using center instead of south with the magick commands to properly center the text in the box.

proud seal
#

for adjusting overlays and such things, i found south the better option, cause you know even for short text where it lands, if it gets centered inside this box too, it makes it harder to find the correct offset.

proud seal
fresh gorge
#

What about a -Test mode that does one thing.... produces a test output based on the settings in the config. Essentially producing one output with zero images and just the overlay, border settings, text settings, and the blue box so people can "see" what happens before applying it to all the downloads?

proud seal
#

good idea

fresh gorge
#

And I would not make it a white box. Keep that part transparent just like the output.

#

You pick your favourite movie. Or maybe you pick your favorite "short text movie" and favourite "long text movie"

#

So -Test produces 2 images only.

fresh gorge
fresh gorge
#

Suggestion for readme:

If its set to xx the script will focus on grabbing textless posters, if you set en to the beginning it will focus on grabbing en.```

Is there a limit? Can we put just 1? Can we put 10? What is the proper 2 digit code to use? Is it <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>? upper case or lower case?(Seems like lower, but maybe specify case in the readme)?
proud seal
#

there is an example of it in readme and in config? ๐Ÿ˜„

#

no limit

#

and it differs on the providers, but it should work with "en" "de" "ru" on fanart and tmdb
tvdd uses "eng" "deu" "rus" but i specified "en*" so it gets matched too, so just the 2 char of lang should be the way to go.

#

but i adjusted the readme., the error you get there is strange, looks like the git pull failed, try to copy the script again.

#

@fresh gorge sry my fault, a "#" too much, should be fixed

fresh gorge
#

ok. so we might just want to clarify the iso code to use with the reference. Some people will put all kinds of weird things...

proud seal
#

already added to readme

fresh gorge
#

interesting how the "season" ends up being MINISERIES?

#

Its what is found in the csv, so I guess its normal

proud seal
#

hmm strange ๐Ÿ˜„

proud seal
#

Any errors during test run with prefered language as en?

fresh gorge
#

I am still trying xx,en,de

#

will try en,xx,de next

fresh gorge
#

there are issues... I will share shortly... but essentially, the seasons are not getting downloaded

proud seal
#

With xx? Or with en?

#

Because if textless is prefered, the parts are unchanged and should works as before๐Ÿค”

fresh gorge
#

en,xx,de

#

let it finsih and I can share

#

only 65 images were created... show poster only

#

fyi, for troubleshooting, you might want to add the results of the settings from config.json (minus the keys) so that the log file has everything in there and we know what values the user used.

proud seal
#

I will have a look tomorrow - in my testlibs it created show, season and movie poster in en ๐Ÿค”

modern pebble
#

Default box/text sizes

fresh gorge
#

It will depend on your font

modern pebble
#

New settings

fresh gorge
#

and if you use ALL CAPS or not

modern pebble
#

I still want to play around with it a bit. I was using the arial bold font but switch to just arial. This will probably keep me busy for weeks LOL

fresh gorge
#

I am an "ALL CAPS" kind of person for this stuff...

#

And if you use collections from our defaults, then ComfortAa-Medium is the font to use and in ALL CAPS to have a similar and consistent view across libraries and collections

modern pebble
fresh gorge
#

thats using a custom gradient

#

gradient used here: uparrow

modern pebble
#

What's your settings on those?

fresh gorge
#

oh... I am messing around... but if you want to know...

#
    "OverlayPart":{
      "ImageProcessing": "true",
      "fontAllCaps": "true",
      "AddBorder": "false",
      "AddText": "true",
      "AddOverlay": "true",
      "fontcolor": "white",
      "bordercolor": "white",
      "minPointSize": "100",
      "maxPointSize": "250",
      "borderwidth": "30",
      "MaxWidth": "1300",
      "MaxHeight": "500",
      "text_offset": "+300"
modern pebble
#

I was worried about decreasing the box width and you're running 125px narrower than I am!

fresh gorge
#

like I said... I am messing around

modern pebble
#

I do like the all caps, it looks larger.

fresh gorge
#

and recall that the fonts will also impact results

#

i will share a collage so that you can grab and zoom in to see the results

modern pebble
#

So you don't do any other overlays?

fresh gorge
#

no... not saying that... the above is strictly in terms of the PPM tool

#

I have way too many overlays for me to use text and overlay

#

hmm... i wonder why i am missing hte looney tunes ones...

#

in the earlier collage

#

rerunning and its now finding the fanart for looney tunes

modern pebble
#

Made some changes, I'm going to let it run and see how they look. Thanks for the tips!

fresh gorge
#

YW

modern pebble
#

If a poster with text exists and a new poster without text is uploaded, will it grab the textless poster on the next run?

fresh gorge
#

You need to delete the text poster locally and then yes

#

However, tmdb can take up to 8 hours before api sees the changes

modern pebble
#

I'm really liking the posters with the all caps. I think I got the spacing just right as the ribbon isn't covering any text (that I could find). I might need to go a bit darker on the gradient overlay, but still very pleased with the results.

urban nebula
#

Is code base for this tool open source at all? Would love to have a look to see how everything is working if so

proud seal
urban nebula
#

Legend thanks! Trying to brush up on PS skills for work so figured Iโ€™d have a look to try to understand what is going on and grab some tips lol

proud seal
#

Good Luck ๐Ÿ˜„

proud seal
fresh gorge
#

Nice!

#

Did you have a chance to see why things don't fully work for seasons when I use en, xx, de?

proud seal
fresh gorge
#

Ok. I will try it all out

#

Ok... feedback time. ๐Ÿ˜‰

#

I read the readme... you specify two modes, manual, automatic... and then down below you mention testing mode. I recommend adding the testing mode option above as well.

Secondly, rather than include test image.png, use the magick command to create the file.

Thirdly, if someone is testing with white borders, having a white image is an issue. Not sure if your -Testing uses all settings from the config.json file. And if so, that would mean applying the gradient and border settings if applicable. So I'd suggest that the test image.png that is created is something like magick.exe -size: 2000x3000 xc: transparent background none .\\temp\\TestImage.png

#

The bug where seasons is not pulled is still there

proud seal
fresh gorge
#

And I know they have en images because they were poisoning the textless ones when I was starting all of this...

#

I will share the logs

proud seal
#

how can it be that i can create over 2000 pics with en, and you dont? ๐Ÿ˜„

mystic juncoBOT
#

The following was shared by @fresh gorge and was automatically redacted by Luma as it may have contained sensitive information.

If you feel this message should not have been redacted, resend it with !noredact in your message to avoid redaction.

fresh gorge
#

Strange that message at the end... the green line is 100% accurate

#

Not the expected outcome, but accurate

#

The 307 is not accurate... I'd focus in the season section of the script.

#

And now the log has my settings so you can use my exact settings to see why my little library is causing so many issues. :-p

rare tulip
fresh gorge
#

magick.exe -size 2000x3000 xc:transparent -background None ..\..\PosterMaker\Testimage.png

fresh gorge
#

This way is someone wants to test with their own kids Verla's file and border settings, they will see the results in the output files

#

$response = (Invoke-WebRequest -Uri "https://api.themoviedb.org/3/tv/$($global:tmdbid)/season/$global:SeasonNumber/images?append_to_response=images&language=xx&include_image_language=en,null,de" -Method GET -Headers $global:headers -ErrorAction SilentlyContinue).content | ConvertFrom-Json -ErrorAction SilentlyContinue

#

I'm wondering why this is hardcoded?

#

Shouldn't that be a variable that is passed based on the value of what is in config.json?

#

Line 272

#

function GetTMDBSeasonPoster {

#

From what I see there, it's impossible that it works for you

proud seal
#

you mean like this? ๐Ÿ˜„

fresh gorge
#

Is that what the image looks like with your overlay.png?

proud seal
#

yep

fresh gorge
#

On a pink image?

#

I think maybe it's the way we create it

#

Maybe that background "none" is messing it up

proud seal
#

yep with blue background on texbox

fresh gorge
#

The other option is making the testimage a jpg which should remove all the layers so you are starting with something that is exactly like a downloaded tmdb jpg.

#

magick.exe -size 2000x3000 xc:pink .\PosterMaker\Testimage.jpg

proud seal
#

boarder, overlay, text, textbox

fresh gorge
#

Likely because the case sensitive nature of GitHub

proud seal
#

removed that part in latest

fresh gorge
#

Ok. Have a meeting now and will test new version in a bit

proud seal
fresh gorge
#

Did you mean to name the bold files CAPS?

#

Like all the *bold.jpg" are the ones that are all CAPS

proud seal
#

Oh good catch ๐Ÿคฃ

fresh gorge
#

Ok. Just checking. That's an easy fix

#

Test folder and my crazy settings are working

fresh gorge
#

Summary and not Summery

fresh gorge
#

Been trying to troubleshoot the reason why season posters are not download. I do not know why yet.

modern pebble
#

Maybe that's why?

fresh gorge
#

Oh.... ???

#

So my config says true but logs say false

#

But logs also show that it's attempting to download season posters and unable to

modern pebble
#

Mine says true also but the logs also show true.

fresh gorge
#

Flip it from xx,en to en,xx

#

When I prefer textless, season posters are downloaded

#

When I prefer en, then season posters don't download

modern pebble
#

I changed it to en, xx then deleted an asset directory for a TV show, ran the script and it downloaded new art work for the series and the seasons. Then I did it again and got the same results.

fresh gorge
#

Strange

#

You are using folders... hmmm

#

Let me try folders and see

modern pebble
#

Just swapped back to xx, en and it grabbed textless series and season posters

#

Also just did a git pull to make sure I had latest, which I do.

fresh gorge
#

I think my issue was that the terminal I was working in got hosed. Started a new terminal and things seem to be better

fresh gorge
#

Essentially, those should be two different variables to report what is written in the config.json file

modern pebble
fresh gorge
#

should likely be this:

#
Write-log -Subtext "| Create Library Folders:   $LibraryFolders" -Path $configLogging -Type Info
Write-log -Subtext "| Create Season Posters:    $global:SeasonPosters" -Path $configLogging -Type Info
#

at line 931

proud seal
#

Ah thanks, good catch.
So it now works with en langugae for you too?

fresh gorge
#

Yes it does. Was a terminal window that was just messed up after having run about 10 different versions of ppm

proud seal
#

๐Ÿ˜„ good

fresh gorge
#

Yeah...for sure

proud seal
#

now its time to work on integration of TPDB ๐Ÿ˜„

fresh gorge
#

No api, right?

proud seal
#

without api yeah

fresh gorge
#

Here are 2 additional ideas...

Point ppm to a folder of images and sub folders of images and have it apply the overlays/text/border settings but into a new output directory so it does not overwrite the source

#

Another source in addition to fanart and tmdb, and tvdb, and IMDb could be to use Plex as the source... selected posters in Plex

proud seal
#

I thought about mass processing of images in a folder, but to be useful for the user he would have to name them manually before/after the processing in order to be useable in pmm.

#

Plex as source would only make sense if no pmm is in place.

fresh gorge
#

Or change the color of their border

fresh gorge
#

Bad source naming equals bad naming in output.

#

How about grabbing backgrounds? PMM applies backgrounds... not sure about applying overlays to backgrounds but that would also be a good to grab and stuff into the output folder

#

Episode cards are also available on tmdb so that could be stuffed as well into the assets directory

#

This way you would have a complete "assets" directory

#

Movies, shows, seasons, episodes, backgrounds

#

Backgrounds I would only apply a resize. No text or borders

#

We'd need to know the official Plex background dimensions

#

Episode cards are an area where I would offer all options as posters but would require different height and width for the box as it is landscape and not portrait. We'd need the official size of episode cards as well to resize them.

#

And likely a different overlay file to respect the dimensions of the episode cards

#

Pretty sure 1920x1080 or 3840x2160 would be correct for background and episode cards

modern pebble
fresh gorge
#

Yeah... I can't multiply... lol

#

fixed now to 3840x2160

proud seal
#

Currently i Fokus on posters, for episodes there is tcm

fresh gorge
#

well... so there are people that use gap, there are people that use tcm, there are people that now use ppm, and there are people that are using other stuff as well....

If the focus is to get/create a complete assets directory that is "clean" and without anything applied so that you can always then decide how you want to alter images, ppm could meet that need very nicely when you don't apply overlay/border/text

#

tcm still needs a source of images if I recall

proud seal
#

That's true, but it would take a lot of time to integrate all this, and makes things even more complicated.

#

Before i start integration other things i want to integrate all needed providers for posters

modern pebble
#

I briefly looked at tcm but there was something that stopped me from going any farther (not sure if you needed an invite to grab the code?). I then saw this and I think you've done a great job with it!

fresh gorge
#

what other providers were you thinking of? I guess tpdb, although they are currently rate limiting and they dont have am api which could mean lots more to break on your side?

proud seal
#

Currently only tpdb is on my agenda, its possible without api, just web requests, i thought to add the user names some likes to grap posters from, also text or textless option is available, and then on first script run i cache all posters from the users with posterid and name, later and on other script runs i then just appens those who where created recently by the user, this would speed up the search for tpdb, cause if i do not cache it, it has to go thrrew each page til it finds that show or movie ๐Ÿ˜…

fresh gorge
#

i think that we also had some people use other providers when tpdb was down

proud seal
#

could be yeah

fresh gorge
#

thats the one that i found some people were using

#

i dont know much about it

proud seal
#

looks good, but no api and login required :/

fresh gorge
#

ahhh... there you go... I was not sure

#

PR submitted to replace Summery with Summary

fresh gorge
fresh gorge
covert eagleBOT
#
fscorrupt/Plex-Poster-Maker

update Summery to Summary

State:

Open

Comments:

0

Review Comments:

0

Commits:

3

Is Locked:

False

Is Draft:

False

Auto Merge:

False

Is Merged:

False

Mergeable State:

Unknown

Labels:

``

Modifications:
+10
1
-8
fresh gorge
#

I also started to look into adding the query to grab the backgrounds... and quickly got overwhelmed... realising that we'd need to create a separate backgroundUrl instead of posterUrl... and then realising that the resize was not a function, so all the 2000x3000 lines (and there are a lot... like 20) would need to be duplicated as 3840x2160 for backgrounds... but in doing so, would make maintaining this even more difficult... so I stopped..

#

was really easy to create this function as it required minimal edits for it to grab backgrounds

#

likely pretty easy to do the same for fanart, and tvdb. Maybe not possible for IMDb.

#

Its all the other logic that is worrying me

proud seal
#

The background, episode part has to be seperated like the season part first show/movie poster, then background, then season then episode poster

#

Im already working on a imagemagick function to simplify this process

#

But i do not have a lot time the next weeks, vacation is over ๐Ÿฅน

fresh gorge
#

If you look at the PR I submitted, its pretty harmless... typos and an additional logging line to share the libraries that are included in the output

fresh gorge
#

I do what I can. ๐Ÿ˜‰

#

Consider that for moives you dump a null instead of System.String[] into that column

proud seal
#

Looks like a you problem, it only gets data if there is data in plex ๐Ÿ˜…

#

On my movie libs, this is always empty

fresh gorge
#

hmmm...

#

if the $Metadata.MediaContainer.$contentquery.type != "show" shouldnt it just be null?

#

in any case I think I see the bug

#

just testing

#

FIXED

#

Let me PR the fix

#

basically... because seasons get processed first, the last value stays within the 4 season variables.... setting them to null at the beginning of the script ensured that when teh csv is created, it works

#
$SeasonNames = $null
$Seasondata = $null
$SeasonsTemp = $null
$SeasonNumbers = $null
covert eagleBOT
proud seal
#

For you, cause you have a strange cache issue in your powershell, if the script is started in a fresh session the variables do not exist before ๐Ÿ˜…

fresh gorge
#

If you run it multiple times, I suspect the same will happen

#

and I mean.. in the same window

#

I also saw it running in vscode and happening there

#

its probably best practice to always set variables to $null as you start the app

#

kinda like the days of adding Option Explicit to vba and vbscripts

#

add Set-StrictMode -version 2
to line 5 and watch what happens....

#

for example, look at what happens here:

#

not a huge deal but it would be best to set that variable

proud seal
#

Thats more like an copy issue, that variBle is not set cause its not needed on subtext

#

This line can be removed, never got an error tho๐Ÿ˜…

fresh gorge
#

I get it... just saying that I think that "some" of the problems are related to some variables abd their variables being set/cached from previous runs... by not resetting them upon start of the script, you can have things like this happen... like they happen to me.

#

And the "error" is seasons is not an error per se... its just adding a value that is not valid

#

Anyhow... I will just look for these little things and propose some fixes. You can accept or not those and move on... no biggie.

fresh gorge
#

when you run script twice, back to back... since the first time, the script gets everything, PosterChoices.csv exists and there are no errors

#

if you rerun, since nothing is found or downloaded, PosterChoices.csv does not exist and then you get this

modern pebble
#

I would concur that you need to initialize all variables before use so they don't have unpredictable values. That way, if you run the script 100 times over and over, you get predictable results.

covert eagleBOT
fresh gorge
#

PR kinda srrange since I only added a file check

#
    Write-log -Message "Finished, Total posters created: $posterCount | Total Season Posters created: $SeasonCount" -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Success
    if ((Test-Path "$global:ScriptRoot\Logs\PosterChoices.csv")) {
        Write-log -Message "You can find a detailed Summary of Poster Choices here: $global:ScriptRoot\Logs\PosterChoices.csv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Type Info
        # Calculate Summary
        $SummaryCount = Import-Csv -LiteralPath "$global:ScriptRoot\Logs\PosterChoices.csv" -Delimiter ';'
        $FallbackCount = @($SummaryCount | Where-Object Fallback -eq 'True')
        $TextlessCount = @($SummaryCount | Where-Object Textless -eq 'True')
        $TextTruncatedCount = @($SummaryCount | Where-Object TextTruncated -eq 'True')
        $TextCount = @($SummaryCount | Where-Object Textless -eq 'False')    
    }

Around line 2020

modern pebble
#

Well that's a mess!

fresh gorge
#

How do you mean?

#

Formatting issue possibly?

proud seal
#

Background image processing is added in latest

fresh gorge
fresh gorge
#

A couple of questions:
1- I saw that you removed the two lines at the top to remove-variable and clear. Was that causing a problem or not doing anything?
2-I see that you added the ability to add text and overlay. However because of the orientation and dimensions of the overlay file, I think we either need to resize the current overlay or reference an backgroundOverlay variable?

#

So maybe a resize on the overlay file would be best so that you don't need an extra variable in config.json

#

And then in the script, when applying the overlay to a landscape background, it references the temp resized overlay file.

#

I also think that you added the poster choices.csv check at the end so you can kill my PR.

proud seal
#

1st, yeah it also cleared the params and testing mode was not possible anymore ๐Ÿ˜…

Maybe possible for your overlay, if i want to do it with mine it would strech it to look ugly, second overlay is the way i think, also when adding title cards as well then a second overlay would be handy

fresh gorge
#

Oh? I figured a gradient stretch would not look bad, but no idea

#

And yes, I guess the most flexible is adding a separate overlay

proud seal
#

In 3h im at the pc, then i can make the changes for it.

fresh gorge
#

I think you may want to consider an overlay dimension check. If the dimensions of the overlay is not 2000x3000, post a warning/error to the logs. If landscapeOverlay dimensions is not 3840x2160, post a warning/error to the logs

fresh gorge
#

Have a great day. So far this version looks like it's working great. I will post things if I find anything.

#

Oh.... this one is probably a little more painful.... in landscape mode, the text box shape should probably be a different dimension because it's wider, so I would want to make it much wider and less height for the background/episode cards.

proud seal
#

Yeah i will add for backgroud a seperate part in config.json

fresh gorge
#

as an example of what i meant. Probably need a text_offset_landscape as well...

#

-testing should now include landscape tests as well.

proud seal
#

Yep, i know what you mean, adding it today ๐Ÿ‘

fresh gorge
#

No problem... just posting my findings here.

modern pebble
fresh gorge
#

That's why I told FSCorrupt to kill it when he has a chance

#

The more I think about config.json, the more I think we might want to have a section called OverlayPartBackground

Right now, there is no way to apply text to poster, but not to the background.

#

It's both or none.

#

I take that back

#

Having them as separate parts would just make it easier to know what is being applied

#

And how per type

modern pebble
#

The text box size on the background needs to be addressed. Possibly the offset as well.

proud seal
#

Yep, adding this as config part in the evening

fresh gorge
#

To minimize scrolling... ๐Ÿ˜‰

modern pebble
#

I've noticed that when it can't find a background that there is no separation line "-------" between the current background search and the next one (both onscreen and in the logs).

#

Happens with posters, too.

fresh gorge
#

Screenshot illustrating that could be helpful

#

In this case, since backgrounds are part of the numbers, should the word images be used instead of posters? Or maybe different/additional stats per image type should be reported? Season fallback versus movie fallback versus season background fallback versus movie background fallback?

modern pebble
#

No separation between searches in the log

#

But it seems only when it can't find a poster/background

proud seal
fresh gorge
proud seal
#

set add overlay,text,boarder to false? ๐Ÿ˜„

fresh gorge
#

Ahhhh yes! I feel silly.

proud seal
modern pebble
fresh gorge
#
function Check-ImageDimensions {
    param(
        [string]$imagePath,
        [int]$expectedWidth,
        [int]$expectedHeight
    )

    $image = [System.Drawing.Image]::FromFile($imagePath)
    $actualWidth = $image.Width
    $actualHeight = $image.Height

    if ($actualWidth -eq $expectedWidth -and $actualHeight -eq $expectedHeight) {
        return $true
    } else {
        return $false
    }
}

# Example usage:
$width = 800
$height = 600
$imagePath = "C:\Path\To\Your\Image.jpg"

$result = Check-ImageDimensions -imagePath $imagePath -expectedWidth $width -expectedHeight $height
Write-Host $result
modern pebble
#

Additionally, got this but the lines don't show in the log file.

fresh gorge
#

Write-log -Subtext "| Script Root: $global:ScriptRoot" -Path configLogging -Type Info

Should probably be:
Write-log -Subtext "| Script Root: $global:ScriptRoot" -Path $configLogging -Type Info

proud seal
modern pebble
proud seal
#

what you mean with separation?

modern pebble
#

This is how it looks with successful grabs

#

This is how it looks on unsuccessful grabs

proud seal
#

ahhhhhh, okey

#

now you should be happy again, also the count issue is fixed

fresh gorge
#

Let me go grab the latest

#

Because of that line, a file gets created in the ppm location.

proud seal
#

Should be all sorted now

#

Tried title cards to, got headache and quited๐Ÿ˜‚
This will take some time to integrate๐Ÿฅฒ

fresh gorge
#

Here is another easy fix

mystic juncoBOT
#

The following was shared by @fresh gorge and was automatically redacted by Luma as it may have contained sensitive information.

If you feel this message should not have been redacted, resend it with !noredact in your message to avoid redaction.

fresh gorge
#

To fix this:

mystic juncoBOT
#
if ($PlexToken) {
    Write-log -Subtext "| Plex Token: (redacted by Luma)
}
Else {
    Write-log -Subtext "| Plex Token: (redacted by Luma)
}
fresh gorge
modern pebble
#

Do the api tokens really need to be printed in the log, no matter how redacted?

modern pebble
modern pebble
fresh gorge
#

!noredact

if ($PlexToken) {
    Write-log -Subtext "| Plex Token:                   $($PlexToken[0..7] -join '')****" -Path $configLogging  -Type Info
}
Else {
    Write-log -Subtext "| Plex Token:                   No Token in Config" -Path $configLogging  -Type Info
}
fresh gorge
modern pebble
# fresh gorge Replace 0..7 with 0..1 and it will only show first character.

Sure that would work, but if it's there I'm not sure why it needs to be logged. If it's missing it would make more sense. Doesn't really matter to me either way but if you're going to redact it, why log it (so long as it's present). I'd think it would be more important to log it if the token is missing.

fresh gorge
#

The reality is from a troubleshooting perspective, we can at least look and see part of the information... to see if the user may have put something or nothing in those fields... and avoids us asking for a redacted config.json file

#
# Plex Part
Write-log -Subtext "API Part" -Path $configLogging -Type Trace
Write-log -Subtext "| TVDB API Key:                 $($global:tvdbapi[0..0] -join '')**(redacted)**" -Path $configLogging -Type Info
Write-log -Subtext "| TMDB API Token:               $($global:tmdbtoken[0..0] -join '')**(redacted)**" -Path $configLogging -Type Info
Write-log -Subtext "| Fanart API Key:               $($FanartTvAPIKey[0..0] -join '')**(redacted)**" -Path $configLogging -Type Info
if ($PlexToken) {
    Write-log -Subtext "| Plex Token:                   $($PlexToken[0..0] -join '')**(redacted)**" -Path $configLogging  -Type Info
}
Else {
    Write-log -Subtext "| Plex Token:                   No Token in Config" -Path $configLogging  -Type Info
}
Write-log -Subtext "| Fav Provider:                 $global:FavProvider" -Path $configLogging  -Type Info
Write-log -Subtext "| Prefered Lang Order:          $($global:PreferedLanguageOrder -join ',')" -Path $configLogging  -Type Info
Write-log -Subtext "Plex Part" -Path $configLogging  -Type Trace
Write-log -Subtext "| Excluded Libs:                $($LibstoExclude -join ',')" -Path $configLogging -Type Info
Write-log -Subtext "| Plex Url:                     $($PlexUrl[0..10] -join '')**(redacted)**" -Path $configLogging -Type Info
modern pebble
#

Yeah, I suppose that makes sense.

fresh gorge
#

Another "easy" change.... 1 line that uses where should be Where-Object

#

Also the System.String[] issue came back... I will PR that fix along with the above

covert eagleBOT
#
fscorrupt/Plex-Poster-Maker

Update PlexPosterMaker.ps1 to add initialize variables section and fix where to Where-Object

State:

Open

Comments:

0

Review Comments:

0

Commits:

1

Is Locked:

False

Is Draft:

False

Auto Merge:

False

Is Merged:

False

Is Mergeable:

True

Mergeable State:

Clean

Labels:

``

Modifications:
+7
1
-1
fresh gorge
covert eagleBOT
#
fscorrupt/Plex-Poster-Maker

N/A

State:

Open

Comments:

0

Review Comments:

0

Commits:

1

Is Locked:

False

Is Draft:

False

Auto Merge:

False

Is Merged:

False

Is Mergeable:

True

Mergeable State:

Clean

Labels:

``

Modifications:
+9
1
-8
fresh gorge
#

Hope your headache is better. ๐Ÿ˜‰

proud seal
fresh gorge
#

Creating a sub folder off of the ppm folder called images and then just reference them from the readme.?

proud seal
#

okey is changed

fresh gorge
#

Did you want to add a testing image for background overlay?

proud seal
#

i removed the check dimension function, it did not worked on my site

fresh gorge
fresh gorge
#
[2024-03-03 11:25:12] INFO    | Start Poster Search for: Indiana Jones and the Kingdom of the Crystal Skull
[2024-03-03 11:25:12] TRACE   |      Searching on TMDB for a movie poster
[2024-03-03 11:25:12] SUCCESS |      Found Textless Poster on TMDB
[2024-03-03 11:25:13] INFO    |      Poster url: https://image.tmdb.org/t/p/original/yWA04fzkt4ChybmRGoRWKe90udd.jpg
[2024-03-03 11:25:13] DEBUG   |      Downloading Textless Poster from 'TMDB'
[2024-03-03 11:25:13] INFO    |      Processing Poster for: "INDIANA JONES AND THE KINGDOM OF THE CRYSTAL SKULL"
[2024-03-03 11:25:13] INFO    |      Resizing it | Adding Borders | Adding Overlay
[2024-03-03 11:25:16] WARNING |      Text truncated! optimalFontSize: 95 below min_pointsize: 100
[2024-03-03 11:25:16] INFO    |      Optimal font size set to: '100'
[2024-03-03 11:25:16] INFO    |      Applying Font text: "INDIANA JONES AND THE KINGDOM OF THE CRYSTAL SKULL"
[2024-03-03 11:25:17] INFO    |      --------------------------------------------------------------------------------
[2024-03-03 11:25:17] INFO    | Start Background Search for: Indiana Jones and the Kingdom of the Crystal Skull
[2024-03-03 11:25:17] TRACE   |      Searching on TMDB for a movie background
[2024-03-03 11:25:17] SUCCESS |      Found Textless background on TMDB
[2024-03-03 11:25:17] INFO    |      Poster url: https://image.tmdb.org/t/p/original/bXH4lyFS6tctnBgxK1eYRuwekR0.jpg
[2024-03-03 11:25:17] DEBUG   |      Downloading Textless background from 'TMDB'
[2024-03-03 11:25:17] INFO    |      Processing background for: "INDIANA JONES AND THE KINGDOM OF THE CRYSTAL SKULL"
[2024-03-03 11:25:17] INFO    |      Resizing it | Adding Borders | Adding Overlay
[2024-03-03 11:25:23] INFO    |      Optimal font size set to: '175'
[2024-03-03 11:25:23] INFO    |      Applying Font text: "INDIANA JONES AND THE KINGDOM OF THE CRYSTAL SKULL"
#

so the CSV shows that text was truncated for the background, however logs do not show that. I think this is a case of variable not being re-initialized before checking for optimalsize

modern pebble
#

The log shows your minimum text size is 100 but it wanted to set it to 95 so it truncated it, if I'm reading that right.

fresh gorge
modern pebble
#

Ahh, ok.

proud seal
fresh gorge
proud seal
#

hmm i thought ive added all relevant information ๐Ÿค”
but i now need a break, coded 12h on this today ^^

#

See Ya tomorrow ๐Ÿ˜„

fresh gorge
#

Yes. this looks great and will test...

modern pebble
#

I'm not really familiar with title cards. Is this supposed to download an episode image to make a title card or does the image already need to exist, or ??? I've run it and no title cards were made. Not sure if I'm doing something wrong.

fresh gorge
#

looks like a remnant from your testing....

#

also, I dont think the data is getting pulled properly from the xml. In my xml, I dont see grandparenttitle... I do see parentTitle... but a bit further down, episodes are not captured, but rather seasons...

fresh gorge
#

There are some logic issues around lines 2369 $tempseasondata = New-Object psobject
this keeps wiping out the information found and then does not download anything because it gets flushed before downloads occur.

#

also line 2361 needs to change to: [xml]$Seasondata = (Invoke-WebRequest $PlexUrl/library/metadata/$key/children?X-Plex-Token=$PlexToken).content

before you had $ratingKey which does not make sense as grandparentTitle did not exist and the else statement uses $key

fresh gorge
#

and Iactually, I think that with those adjustments, the script starts to work again

fresh gorge
fresh gorge
#

title cards are the 16:9 episode images in plex

fresh gorge
proud seal
#

PR is merged ๐Ÿ‘

fresh gorge
#

Still another little glitch with some counters, but I will share tomorrow. Related to title cards and truncated text

fresh gorge
#

So I just noticed this today... the characters are showing really weird for some episodes. I don't think I saw this on the other csv files

#

Ok, forget that... looks like I need to fix my import into excel because csv in notepad ++ is fine

fresh gorge
#

OK... so back to the original issue that I saw last night about counts and the csv and more....

[2024-03-04 01:58:24] TRACE   |      Searching on TMDB for: Family Guy 'Season 8 - Episode 21' Title Card
[2024-03-04 01:58:24] WARNING |      TMDB Api Response is null
[2024-03-04 01:58:24] TRACE   |      Searching on TVDB for a Title Card
[2024-03-04 01:58:24] OPTIONAL|      Found Textless Title Card on TVDB
[2024-03-04 01:58:24] INFO    |      Title Card url: https://artworks.thetvdb.com/banners/episodes/75978/2380591.jpg
[2024-03-04 01:58:24] DEBUG   |      Downloading Poster from 'TVDB'
[2024-03-04 01:58:24] INFO    |      Resizing it | Adding Borders | Adding Overlay
[2024-03-04 01:58:27] INFO    |      Optimal font size set to: '223'
[2024-03-04 01:58:27] INFO    |      Applying EPTitle text: "EPISODE 21"
[2024-03-04 01:58:29] INFO    |      Optimal font size set to: '81'
[2024-03-04 01:58:29] INFO    |      Applying SeasonEPNumber text: "SEASON 8 โ€ข EPISODE 21"
[2024-03-04 01:58:30] INFO    |      --------------------------------------------------------------------------------

Notice how the logs are not complaining at all about "Truncated", yet... in the ImageChoices.csv (3rd TRUE is for Truncation:

"S08E20 | SOMETHING, SOMETHING, SOMETHING, DARK SIDE";"Episode";"Family Guy (1999) [imdbid-tt0182576]";"TV Shows";"True";"False";"True";"https://image.tmdb.org/t/p/original/wx0EJqtfatuhCAXDGAK912b0hgU.jpg"
"S08E21 | EPISODE 21";"Episode";"Family Guy (1999) [imdbid-tt0182576]";"TV Shows";"True";"True";"True";"https://artworks.thetvdb.com/banners/episodes/75978/2380591.jpg"
#

almost like the subsequent episode is keeping the truncated flag when it should not

proud seal
#

Hmm, i had also a few truncated during my last run, but after a truncated was found the next one did not had it set to true.

rare tulip
#

getting this at the start but it seems to be running fine

#

Doh ! my bad... didn't update that line in the config LOL

fresh gorge
proud seal
#

im starting a new run, can take a while - 33.000 episode posters ^^ ๐Ÿ˜„

fresh gorge
#

I have a test library

#

I use that and then I can make the minfont size quite large to "force" truncation

#

the idea is to find the right number so that some pass and some fail

proud seal
#

i did a few runs with the Comfortaa-Medium.ttf
i found this where the best settings:

"PosterOverlayPart": {
    "fontAllCaps": "true",
    "AddBorder": "true",
    "AddText": "true",
    "AddOverlay": "true",
    "fontcolor": "white",
    "bordercolor": "white",
    "minPointSize": "95",
    "maxPointSize": "250",
    "borderwidth": "30",
    "MaxWidth": "1900",
    "MaxHeight": "500",
    "text_offset": "+400"
  },
  "BackgroundOverlayPart": {
    "fontAllCaps": "true",
    "AddOverlay": "true",
    "AddBorder": "true",
    "AddText": "true",
    "fontcolor": "white",
    "bordercolor": "white",
    "minPointSize": "95",
    "maxPointSize": "250",
    "borderwidth": "30",
    "MaxWidth": "3200",
    "MaxHeight": "500",
    "text_offset": "+200"
  },
  "TitleCardOverlayPart": {
    "AddOverlay": "true",
    "AddBorder": "true",
    "bordercolor": "white",
    "borderwidth": "30"
  },
  "TitleCardTitleTextPart": {
    "fontAllCaps": "true",
    "AddEPTitleText": "true",
    "fontcolor": "white",
    "minPointSize": "95",
    "maxPointSize": "250",
    "MaxWidth": "3640",
    "MaxHeight": "350",
    "text_offset": "+300"
  },
  "TitleCardEPTextPart": {
    "fontAllCaps": "true",
    "AddEPText": "true",
    "fontcolor": "white",
    "minPointSize": "60",
    "maxPointSize": "100",
    "MaxWidth": "1200",
    "MaxHeight": "120",
    "text_offset": "+150"
  }```
fresh gorge
#

Here is a good example... summary says 2. logs only find 1. csv shows 2

#

The truth is that only 1 was truncated

#

so summary and csv are incorrect

proud seal
#

okey, maybe there is another null required.

fresh gorge
#

i think so... I was going to try and step through the code with S06E19,20,21 to see what might be happening

proud seal
#

try latest, it may fixed it.

fresh gorge
#

LOL... I found the issue

#

$global:IsTruncated = $null needs to be added to Get-OptimalPointsize

#

by setting this global to null here, anytime you call this function, it will ensure that its null to begin with

proud seal
#

omg yeah ofc ๐Ÿ˜…๐Ÿ˜‚

fresh gorge
#

so your script still fails even with the addtional globalnull that you added... I'd just add it to the function as mentioned above

#

with the addition to the function

#

and csv is fine as well now

#

this is an interesting "find"

#

maybe write the error to the logs as an ERROR?

proud seal
fresh gorge
#

ok... I might need to redo the PR

#

actually... not sure since I only see an update to ps1 from 1 hour ago

#

anyhow... check out the PR as I made some cleanup and added a couple fo enchancements

#
removed some comment lines
added prefix "poster" to test posters
added a delete of all files within the test folder when running -testing added global to get-optimalpointsize
proud seal
#

merged ๐Ÿ‘

fresh gorge
#

rerunning now. I see you also did more cleanup in the script. ๐Ÿ˜‰

fresh gorge
# proud seal merged ๐Ÿ‘

when you mentioned this in the README: Cross-platform Compatibility: Ensures seamless operation across Linux, Docker, and Windows Plex servers, enhancing versatility.

Are you talking about plex being on an platform? Or are you talking about running the ps1 Cross-platform?

proud seal
#

Yeah plex, but in theory the script should also run on linux.

#

Only one dot.net reference is in script, and thats the dimension calculation.

fresh gorge
#

i will test it if I can on an ubuntu VM i have lying around

proud seal
#

Imagemagick needs to be installed manually and the paths would need to be in linux format in config file but the rest should work as it is.

fresh gorge
#

so as you suspected.... dimensions checker is acting up

proud seal
#

And the paths ๐Ÿ˜ฌ

fresh gorge
#

well... not sure about the paths because I am installing imagemagick manually now.... maybe detecting non-windows OS and aborting there would be best?

#

instead of downloading the windows exe?

fresh gorge
#
    if (Test-Path -LiteralPath $magickinstalllocation\magick.exe) {
        Write-log -Subtext "ImageMagick installed here: $magickinstalllocation" -Path $configLogging -Type Success
    }
    Else {
        Write-log -Subtext "Error During installation, please manually install Imagemagick" -Path $configLogging -Type Error
    }```

in ubuntu, 22.04, the install is:

Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

and the file used is `convert` found in `/usr/bin/convert`
#

maybe I could make an ~~alias ~~ symlink to it and call it magick.exe

modern pebble
#

submitted a PR for some README changes/additions. Added titlecard stuff to PrerequisitePart and change LibraryFolders true/false explanation (they were backwards).

native crag
fresh gorge
#

currenty the script requires a path to the executable as part of config.json

#

it uses magick.exe when launching in windows

#

magick.exe does not exist in the unix version of imagemagick

#

so I guess that whole logic would need to be reviewed

native crag
#

yes, I realize that, but it seems like the cleaner solution is to not require an explicit path to the executable but instead to look for it in a platform-independent fashion.

fresh gorge
#

I agree

native crag
fresh gorge
#

yes.. the issue with convert in windows is that its legacy.... so some features may not be at parity...

#

at least that is what I read and understood

#

sudo ln -s /usr/bin/magick.exe /etc/alternatives/convert is getting me a little further....

#

lets see if the fanart module will install

native crag
native crag
fresh gorge
#

oh

#

I am definitely not a unix person

#

oh... that magick download looks interesting

modern pebble
#

ImageMagick version 7 should have magick

fresh gorge
#

lots of path issues to contend with as I believe the assumption when building this was to make it work for windows

fresh gorge
#

gonna try that magick download

native crag
modern pebble
native crag
modern pebble
#

convert, under windows, is a program to convert a FAT volume to NTFS.

native crag
#

it notes that issue and the workaround in that article.

#

But that is an issue to bear in mind.

fresh gorge
#

So the AppImage is v7.1.1.29

#

after checking that libfuse3 was installed and then installing libfuse2, it looks like the AppImage is now executable on Ubuntu 22.04

#

paths issue... gonna need to convert those to be compatible between windows and unix

#

i am just starting with the -testing option

fresh gorge
#

thanks Chaz... that is useful

fresh gorge
#

Making good progress on the paths transformations...

thin sparrow
#

This is very interesting to me because I feel I could/should be using local assets more than just depending on Plex-Meta-Manager-Images and hoping more things get added there. But I'm on MacOS myself. I could help test the cross-platform functionality, or fix anything on the mac side?

fresh gorge
#

sure... but we need to get a v1 for cross-platform running first

#

the source code is available... just try it?

#

but I know the paths will be all wrong

thin sparrow
#

Oh yeah, no pressure. Just thinking about how I can make my stuff better and also help.

I'll install powershell in a bit and see what this is like.

misty cobalt
#

So I haven't really dug into this - it's really neat

#

So my understanding is that it prefers a "textless" poster - what would be cool is if you could set a schedule for it to select a new textless poster, just so the images change every now and again.

fresh gorge
#

if you want english and then fallback to textless, then german en,xx,de

#

as for the option..... you could delete the assets completely, and then rerun... if there are new posters that have arrived and are voted higher on average, then they would be pulled.

#

source can be fanart.tv then tmdb, then tvdb, then imdb

#

or the way I run it is tmdb, then fanart, then tvdb, then imdb

#

@proud seal , I think I have a running cross-platform version of the script... I will create the PR for it.

fresh gorge
#

its not perfect, but definitely a good version 1 of a cross-platform version

proud seal
# fresh gorge its not perfect, but definitely a good version 1 of a cross-platform version

i will let this one open til its a complete working one, just tried it on a ubu 22.04 and there is not really anything that works ๐Ÿ˜„ it has to cover all parts like on windows, then i can merge it.

Okey, made some changes, it now works on Linux to, imagemagick "install" is also covered.

Also had to fix the join paths, cause with your changes you broke the windows version ๐Ÿ˜…

fresh gorge
#

Oh? I was testing on windows and Ubuntu and the t seemed to be working. To be fair, I was working on -testing and I thought I had that correct. Then I moved on to the rest. I know I had broken some things along the way.... but also did a test run on my test libraries and it worked with windows and Ubuntu... I guess I missed some things. Also my testing was not as exhaustive as I would have liked...

#

I went to bed last night to run things against the full library

#

No idea what it looks like this morning

#

Yup.... something broken in full run that was not broken in test run

#

Omg.... and my Ubuntu run is still going... x that VM is so slow!!!

proud seal
#

should be fixed now ๐Ÿ™‚

fresh gorge
#

Yup... gonna go see the diff between your fixes and what I did.

proud seal
fresh gorge
#

One question:

# Cleanup old log files
$logFilesToDelete = @("Manuallog.log", "Testinglog.log", "ImageMagickCommands.log", "Scriptlog.log", "ImageChoices.csv", "PlexLibexport.csv", "PlexEpisodeExport.csv")

Why are you not removing all files in the logs folder upon launch?

#

I added the extra files and you removed them

proud seal
#

csvยดs are not log files, i like to keep them.

fresh gorge
#

They get overwritten don't they?

proud seal
#

yeah, but if i want to check after i run and a schedule or so is starting it would delete them right after script start, in this case i can abrort the script and still have the files to check

fresh gorge
#

Indeed. I see. As a future consideration for an enhancement, log rotation with a max number of logs could be considered. So if someone uses 5, then the logs will never grow past 5 of each

proud seal
#

like pmm has or?

fresh gorge
#

Well, I am not crazy about PMM logs

#

I wish the extension would not be .1

#

I like that newest is always the one without anything... like meta.log

#

Also 9 logs is a lot, so a configurable number would be nice

#

So something like this is what I was thinking of:(ignore names of files here as you already have good names)
ScriptLog.log - always the most recent
ScriptLog.2.log - second most recent
ScriptLog.3.log - third most recent log

And since maxLogs is set to 3, this is the most I would get for ScriptLog.log. The same applies for the 3 csv files and the imagemagick logs and the testing logs

#

Btw, the install on Ubuntu worked great for magick

#

Rerunning on windows and Ubuntu now

#

My windows run with all those errors took ~7h. Hoping the new version from your latest will be faster due to less errors

#

A consideration for the README.
Sharing the way to use/connect to the 3 csv with Excel. Using those settings, you can create the 3 connections with the three total rows and then all you do is hit Data | Refresh All and it will grab the latest info from the csv's and present it back in excel.

#

The key in the import is the Semicolon and the 65001: Unicode (UTF-8)

rare tulip
#

working on running this in docker... here is my current docker-compose

version: '3'

services:
powershell_cron:
image: mcr.microsoft.com/powershell:latest
container_name: Postermaker
volumes:
- /share/config/postermaker/PosterTemp:/PosterTemp:rw
- /share/Multimedia/Plex/assets:/assets:rw
- /share/config/postermaker/PosterTemp/config.json:/postermaker/config.json:rw # Mount the configuration file
- ./FanartTvAPI:/FanartTvAPI # Assuming FanartTvAPI is the module directory
command: ["sh", "-c", "while true; do pwsh /PosterTemp/PlexPosterMaker.ps1 -ConfigFile /PosterTemp/config.json; sleep 3600; done"] # Pass the configuration file as a parameter

network_mode: host  # Use host networking for simplicity
restart: always

It almost runs LOL... I just keep getting this error
"AppImages require FUSE to run. You might still be able to extract the contents of this AppImage if you run it with the --appimage-extract option. See https://github.com/AppImage/AppImageKit/wiki/FUSE for more information"

GitHub

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.liber...

proud seal
#

But if you take latest script, it may is not required to do so.

#

How does your Dockerfile look like?

rare tulip
#

I did use the latest script. ๐Ÿ‘ I am using that compose file to create a stack in portainer

proud seal
#

Ah okey, that may not work,

#

I will have a look tomorrow, last powershell container i build is 2 years old ๐Ÿคฃ

rare tulip
#

or maybe switch to a Linux image since the script now runs in Linux also

native crag
#

brand new git clone on ubuntu 22.04:

PowerShell 7.4.1
PS /mnt/hdd/Plex-Poster-Maker> ./PlexPosterMaker.ps1
New-Item: /mnt/hdd/Plex-Poster-Maker/PlexPosterMaker.ps1:40
Line |
  40 |          New-Item -Path $Path -Force | out-null
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Access to the path '/Logs' is denied.
...

and lots of failures follow due to that

Looks like maybe this doesn't work as expected?

$global:ScriptRoot = $PSScriptRoot

Edit, that bit in isolation works fine.

PS /mnt/hdd/Plex-Poster-Maker> ./test.ps1
/mnt/hdd/Plex-Poster-Maker

where test.ps1 is:

Write-Host $PSScriptRoot
proud seal
#

You do have rights to call and create things with the user you are trying it?

native crag
#

I do, but presumably that logs directory should be /mnt/hdd/Plex-Poster-Maker/Logs not /Logs

#

Ah, apparently only happens the first run.

proud seal
#

Yeah, just checked - it was on a false line, fixed in latest.

modern pebble
#

Is it possible to specify the config file? My thought is that I can run the script to create posters when new items are added and then let PMM deal with everything else on the nightly run. The caveat is that I only want to process my movies when a new file is added, and not do TV. Or, when a TV item is added that I don't process Movies. Specifying a config file that locks out all but the one library I can then have Radarr/Sonarr run the script for the respective library. I know there's a lot going on right now, but maybe something to keep in mind?

proud seal
#

I already thought about something like that, but not possible in current state, but in future Definitely a good change ๐Ÿ‘

modern pebble
fresh gorge
modern pebble
#

I can dig it up but I did verify it had the correct id for tvdb, tmdb, and imdb.

fresh gorge
#

Right, so that's what I am looking for as I wanted to trace it back from that point

#

The csv file will contain the tmdbid for Hanna. If you can share that row

modern pebble
#

That's in plexlibexport?

fresh gorge
#

Possibly

#

But might be in the other csv as well

#

One is for show and the other is more for episode cards

modern pebble
fresh gorge
#

Ok so that is accurate

#

54155 is for Hanna

#

Now we need to check the PlexEpisodeExport

#

Should have 3 lines for Hanna

#

Share the rows just before and just after Hanna please

modern pebble
fresh gorge
#

@proud seal it looks like we might be double-counting or those summary variables need to be set to $null upon launch of script

fresh gorge
# modern pebble

Ok... so that is strange... can you try something if it's finished processing?

modern pebble
#

Yes

fresh gorge
#

Go and delete just that show

modern pebble
#

From the asset directory?

fresh gorge
#

Rerun script which should skip everything and just add that

modern pebble
#

I already did that. Same results

fresh gorge
#

That can't be

#

Ok

modern pebble
#

I can do it againi...

fresh gorge
#

Try a new powershell window

#

From that new window, just delete Hanna and rerun.

#

If you want, back up your logs directory first and outside of the PM folder

#

In case you need to refer back to csv 's and logs

modern pebble
#

Running now...

fresh gorge
#

As a separate question, do you have that show/movie called Klute?

modern pebble
#

No

fresh gorge
#

Even stranger then...

#

So the results of this run, since it's only going to show this one show, are you able to zip the logs folder and share the whole thing here?

modern pebble
#

Sure

fresh gorge
#

Great thanks. As I don't have that show in my server, I am gonna try and repro it by pausing the script after it reads in the csv and then adding your rows to trick it into thinking I have that show and then download the images

#

I might also be able to trick Plex in my test library

modern pebble
#

We're meeting friends for music bingo so I have to take off. I'll check back in around 9pm. Thanks!

fresh gorge
#

Poisoned on tmdb:

#

submit a report that this is invalid and they will take it down. Then up to a maximum of 8 hours and the tmdbapi will pull back the proper data

#

what this doe snot explain is WHY ppm decides to fallback to this poster for season 2 and 3. I think its because the tmdbglobalfallback is not reset to null between season searches.

#

so because it does not find textless, it fallsback and reuses the Klute image

modern pebble
#

Dang... I even went and checked the posters, but I guess I didn't look in the right spot. Thanks for checking it out!

fresh gorge
#

well.. there is still that second problem...

#

in theory, you should have season 1 with poisoned poster

#

then season 2 and 3 should have been fine

#

still stepping through to figur ethat part out

modern pebble
#

Should it reuse a textless poster for other seasons if it can't find textless? Or should it just fallback to text posters if it can't find textless for EACH season?

fresh gorge
#

it should try the other providers to find textless

#

which it does not seem to do

modern pebble
#

But if it can't, should it use textless from other season, or use text from the season it's searching for?

#

and by can't, I means can't find textless

fresh gorge
#

pretty sure that each image should first go to the preferred provider and look for the preferred language which is xx,en so textless and then english text

#

so if it cant find textless on tmdb

#

then it goes to fanart

#

then tvdb

#

then back to tmdb to look for en

#

then fanart

#

then tvdb

#

and likly imdb is in that mix as well

#

however, I believe there are logic issues at this point

#

we havent even gottent ot he fact that a season can also have backdrops

#

logic issue is around here:

#

line 3149 restarts the search for the seasonposter, but now it has TMDBfallbackposterurl set to the poisoned image.

#

ont he next iteration for season 2, since it cannot find textless, it defaults to the TMDBfallbackposterurl which is the poisoned image. Repeats again for season 3

#

So I understand why its happening, but not entirely sure how to fix

modern pebble
#

So, that section starts at line 3107 for me, so it looks like maybe you've added some code to your file? But I'll have to spend several hours staring at that for it to start to make sense to me.

fresh gorge
#

like try this... delete only season2 and season3 poster for hanna.... rerun.. and watch how it gets the text posters

#

he released a version ate today

#

i did not add code

#

so notice how it remembered the season2 text and made that the fallback for season 3

modern pebble
#

Didn't see the release, but I'm up to date now. Deleted the two posters and running now.

fresh gorge
#

but if i then delete season3 only

#

this summary is the strangest as well... the green is acurate... the yellow is totally off for some reason

#

I thnk the reason is thatt he summary reads the csv and the csv is no longer being deleted or reset during the run...

#

there should not be those duplicates in there

#

this is also strange for me... why a reference to a P drive?

modern pebble
#

Weird, it's picking up a bunch more title cards that weren't there a few hours ago..

#

Oh... it's using the background image as a title card... that's new

fresh gorge
#

thats not what it should be doing

#

again... probably when it cant find something it fails back

#

but then keeps that

#

i found the issue witht he coutners

#

in an older version of the script, this CSV is deleted

#

now its not there at all and things get appended

#

The other two csv files might suffer from this same issue

modern pebble
#

Yeah, for everything I didn't have a title card for it's falling back to using the background image. That could be okay, but I think it should be optional. That way, if an image becomes available it would use that.

fresh gorge
#

Export-Csv -Path "$global:ScriptRoot\Logs\ImageChoices.csv" -NoTypeInformation -Delimiter ';' -Encoding UTF8 -Force -Append

so without an explicit remove-item, all references to ImageChoices.csv is -Append

fresh gorge
#

$Libraries | Select-Object * | Export-Csv -Path "$global:ScriptRoot\Logs\PlexLibexport.csv" -NoTypeInformation -Delimiter ';' -Encoding UTF8 -Force

#

$Episodedata | Select-Object * | Export-Csv -Path "$global:ScriptRoot\Logs\PlexEpisodeExport.csv" -NoTypeInformation -Delimiter ';' -Encoding UTF8 -Force

#

I will add the logic to delete the ImageChoices.csv and PR that

modern pebble
#

I don't think I noticed that because I have a simple batch file that rotates the logs.

#

So unless I'm just running the script in a powershell window it would rename the logs.

fresh gorge
#

i see... thats a supplemental thing... it should work without that extra thing you added

#

fixed

#

line 1455:
$logFilesToDelete = @("Manuallog.log", "Testinglog.log", "ImageMagickCommands.log", "Scriptlog.log", "ImageChoices.csv")

modern pebble
fresh gorge
#

i shared a log rotation strategy with FSCorrupt so he might implement it thus eliminating the need for your additional wrapper

modern pebble
#

Wouldn't you also want to delete the PlexLibexport.csv also?

#

And PlexEpisodeExport.csv?

fresh gorge
#

no need since if you notice the command used... its not performing the -Append

#

so when it writes the file, it removes it right away

#

now the method used means that if you run in testing mode, the file gets deleted... I know that FS has reasons to keep the file around... however.... not 100% sure.

#

old logic

#

if testing, then it won't touch the ImageChoices.csv

#

and since testing wont get to the other two csv's, they remain as well

#

so my fix is probably not going to be accepted

#

I will update it to this:

# Cleanup old log files
if ($Testing) {
    $logFilesToDelete = @("Manuallog.log", "Testinglog.log", "ImageMagickCommands.log", "Scriptlog.log")
}else{
    $logFilesToDelete = @("Manuallog.log", "Testinglog.log", "ImageMagickCommands.log", "Scriptlog.log", "ImageChoices.csv")
}
#

PR updated

modern pebble
#

Is there some way to add logic so if a title card can't be found to NOT use the show background poster?

fresh gorge
#

yes. like I mentioned, I believe this is a bug and not what was intended originally by the script

#

similar to the logic error we discovered and documented above

modern pebble
#

So I deleted season posters 2 and 3 and it did download posters with text, but at least the right ones.

fresh gorge
#

yes... but this logic is gonna cause you all kinds of problems

proud seal
proud seal
fresh gorge
#

so if a episode titlecard is not found, the fallback is to use the show background?

proud seal
#

yes, to ensure that it does as much as possible, it can be seen as a fallback in the csv and can then be adjusted after the run

fresh gorge
#

i was less focused on the background stuff and more concerned with the other logic issue shared around the Hanna show

proud seal
#

Correct thats an logic issue copied it from show posters

fresh gorge
#

put a tmdb id, outputs the files/folders
if there is a movie and show with same id, it asks you which you want

I used this with tmdbid 54155 (Hanna) which gave me the fake folders and files that I placed in my test library directory so that I could repro the issue from MyPostingID

#

all you need is python, a tmdbkey within the .env file

fresh gorge
#

Line 1429 contains P:\assets which is likely related to your personal setup.

proud seal
#

yeah, only when on linux, cause then the default path was not changed.

fresh gorge
#

So it's checking whether the user has changed the line within config.json to point to a proper posix system path

#

In my case I had a path of c:\ so it did not detect that

proud seal
#

thats not what i want to accomplish, if you enter a false path then its your fault ๐Ÿ˜„
i just want to make sure the user changed my default value on linux, cause P:\ could never exist on a linux system.

fresh gorge
#

then maybe look for :\ in the $AssetPath?

#

๐Ÿ˜‰

proud seal
#

why?

fresh gorge
#

to capture people that move between running this in windows versus linux?

#

in any case, not a big deal

#

i am rerunning with your latest logic changes

proud seal
#

I think i dont get what you want to tell me, what does a check of :\ for windows user should tell them?

fresh gorge
#

doesnt the logic there state that if you are on unix (not win32NT) AND the path is P:\assets to write an error out to the user? and then exits?

proud seal
#

Yes, but on windows a user could have P:\assets like i have

#

So even it is a default config value, it could be a right value, but not on linux

fresh gorge
#

if user is on windows, this logic is skipped, no?

proud seal
#

Correct

fresh gorge
#

sorry... was speaking in a meeting here at work... lol

#

So...
Scenario 1:
I am on windows machine 1 and my config.json has the following path: D:\assets
logic will be skipped because I am on win32NT

Scenario 2:
I am on unix and my config.json has the following path: D:\assets
logic will be skipped because my path is not P:\assets but will have errors later because D:\assets is not valid for a unix system

Scenario 3:
I am on windows machine 2 and my config.json has the following path: D:\assets however, my machine 2 does not have a D: drive and this should have been C:\assets
logic will be skipped because my path is not P:\assets and because I am on win32NT, but will have errors later because D:\assets is not valid for my win32NT system

native crag
#

Why not just check to see if the path exists at runtime and tell the user to fix it if it doesn't?

fresh gorge
#

thats my point

#

in all cases, if the path fails, it needs to be resolved

#

Test-Path and abort if path does not exist and post a meanigful error

native crag
#

I'm saying don't look for some magic characters in the path.

fresh gorge
#

Me too.. I was trying to understand why that logic was there in the first place

#
# Create directories if they don't exist
foreach ($path in $LogsPath, $TempPath, $TestPath, $AssetPath) {
    if (!(Test-Path $path)) {
        if ($global:OSType -ne "Win32NT" -and $path -eq 'P:\assets') {
            Write-Log -Message 'Please change default asset Path...' -Path $configLogging -Type Error
            Exit
        }
        New-Item -ItemType Directory -Path $path -Force | Out-Null
    }
}

I just read the comments

#

this will CREATE folders

#

if they dont exist

#

so its normal that at the beginning, when first run that none of these folders exist

#

it reads from the config.json and then attempts to create the folders

#

the asset folder on a windows system could contain a drive letter

#

and the config.json for a unix system should NOT contain a drive letter for the assetpath

#

$LogsPath, $TempPath, $TestPath are all based off of the running scriptpath so there is nothing to define in the config.json file

#

$AssetPath needs a definition so that you can point the script to your assets folder that PMM can then process

#

so essentially a validation of the values within the config.json should be done for cross-platform compatibility

#

each line in there where someone might put a win32NT value but be running on a POSIX system should have a validation and exit if that validation fails

#
    "PrerequisitePart":{
      "AssetPath": "C:\\users\\bullmoose20\\PosterMaker\\bbb\\shows",
      "magickinstalllocation": "C:\\Program Files\\ImageMagick-7.1.1-Q16-HDRI",

These are the only two parts that someone could screw up if they are moving between windows and unix based systems.. or if they used the default config.json.example directly in a unix system

proud seal
#

The path that the user puts in that config file gets created on windows and on linux, its just a check for the linux users that it cant be created because its in windows format, but yeah i do not have a check integrated that checks for what the user has put in there so you ask for a foolproof logic.

modern pebble
# proud seal Not a logic issue, I'd rather have a backdrop than nothing at all ๐Ÿ˜…

I'd rather have just the plex episode image than have the background. That way, if an image is found, it will update it and I won't have to go looking through 12,000 lines of episodes to figure out what needs to be changed. It's not really automated if I have to do the work to change everything the automation does. Just my two cents, take that for what it's worth....

proud seal
#

i will add plex as provider, so in a future update you can set it as fav provider or as a fallback source.

modern pebble
#

Cool, thanks! I wish it was easy for me but I'm not really familiar with python much less powershell.

fresh gorge
#

Thankfully, that is already part of the exif data and implemented. You just need to know what you are looking for.

#

I can share the exif locations and tags for PMM and TCM

proud seal
#

Thanks, its not something i will start working on soon, i want to optimize the main part before adding new things, still a few bugs and logic issues in current code

fresh gorge
#

this is what I use to scan my assets folders in case something with an overlay from PMM ends up in there or from TCM ends up in there

proud seal
#

Thankszoro

fresh gorge
#

yw. I am trying to understand why Hanna is notpulling that textless image

proud seal
#

Is it still not working ๐Ÿค”

fresh gorge
#

No...someone fixed it on the TMDB site

modern pebble
fresh gorge
#

there is no more textless Klute image for Hanna season 1

#

So I was hoping that it would stay there to test if the logic fix is good

proud seal
#

๐Ÿคฃ

fresh gorge
#

unfortunately we cannot test with Hanna

modern pebble
#

I can change it back....

fresh gorge
#

you cant because its literally GONE

modern pebble
#

That was fast

fresh gorge
#

the Czech and Spanish pages do not have Klute either

#

so its been wiped.. which is a good thing

modern pebble
#

I don't think they ever did. It was just uploaded as a no language poster

fresh gorge
#

you can only change the language in tmdb

#

you cannot delete it

#

you must ask the admins to delete it

modern pebble
#

I changed klute to english and I reported it as a bad poster.

fresh gorge
#

or they must have realised that klute has nothing to do with Hanna and moved it completely

#

so they got rid of it

#

or moved it to the real klute