Author Topic: Help wanted at Script -postersfolderjpg_en-  (Read 1871 times)

0 Members and 1 Guest are viewing this topic.

Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Help wanted at Script -postersfolderjpg_en-
« on: September 15, 2016, 03:46:28 pm »
Hi Ivek, thanks for the welcome.

Until now I have mostly alone fought my way in the scripts.

Now I have two scripts "postersfolderjpg_en" and "posterswithsamename_en" found work great. But here have a problem, this would script "postersfolderjpg_en" change, that it in the position "Front Cover" or "Disc Cover" invites cover.

Have it as far modified the cover properly settles into the "Front Cover" position, but the script hangs when I stopt to cancel click the script and the cover is displayed.

I read in the script help, which without the command "function GetCoverType: smallint;" is automatically imported into front covers.

Question One: Why is this script hanging?

Question Two: What changes should I make where the command "function GetCoverType: smallint;"

Thanks for your help

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #1 on: September 16, 2016, 10:17:34 am »
It is necessary to wait a few days to see if they will find any solution
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #2 on: September 16, 2016, 11:32:42 am »
Ok thanks, will wait.

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #3 on: September 17, 2016, 09:51:47 am »
Question One: Why is this script hanging?

The scripts are missing certain parts of the code, which is why this is happening, like when PVD freezes.

Question Two: What changes should I make where the command "function GetCoverType: smallint;"

This feature does not work as such, it needed be amended in such part
Code: [Select]
function GetCoverType: Byte;
The entire function must be such, however:
Code: [Select]
function GetCoverType : Byte; // 0 - front cover, 1 - disc image
// 0 - Front, 1 - CD
Begin
    Result := 1;
Inc (CoverType);
End;

Even this does not work properly, because there are still some parts of the code are missing in the script.
Code: [Select]
//Global variables
var
 Mode : Byte;
 CoverType: Integer;
and
Code: [Select]
//add poster that is within the same folder as the movie file and is named "Cover.jpg"
function GetDownloadURL : AnsiString;
var
 Path : String;
 P : Integer;
 SlashPos : Integer;
begin
 Path := GetFieldValue(31);
 P := Pos('|', Path);
 if P < 1 then
  P := Length(Path) + 1;
 
 Path := Copy(Path, 1, P - 1);   
 if Path <> '' then
 begin
  Path := ChangeFileExt(Path, '.jpg')
  SlashPos := LastPos('\', Path)
  Delete(Path, SlashPos+1, 999)   //delete whole substring after last '\'
 
  // ! you can edit the filename of your posters here ! (currently it is 'Cover.jpg')
  // the poster file has to be in the same folder as the movie file
  //Path := Path+'Cover.jpg'
  Path := Path+'Disc.jpg'
  //Path := Path+'CD.jpg'
  //Path := Path+'Front.jpg'
  //Path := Path+'Disc image.jpg'
  //Path := Path+'Covers.jpg'
 
  if FileExists(Path) then
  begin
    LogMessage('FILE EXISTS: '+Path)
    AddImageURL(0, Path)
    Result := PATH;
  end
  else
    Result := '';
 end;
 
  if (CoverType = 1) then // (default it is 1 disc image)
Result := ''; 

end;

As can be seen from this part of the code
Code: [Select]
// ! you can edit the filename of your posters here ! (currently it is 'Cover.jpg')
  // the poster file has to be in the same folder as the movie file
  //Path := Path+'Cover.jpg'
  Path := Path+'Disc.jpg'
  //Path := Path+'CD.jpg'
  //Path := Path+'Front.jpg'
  //Path := Path+'Disc image.jpg'
  //Path := Path+'Covers.jpg'
It is to change the image file name, which is essential to the proper script transfer front or disc image in the correct box.

Below is an added version "0.1.0.5" scripts that operate on PVD 0.9.9.21, as well as the latest PVD 1.0.2.7 version.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #4 on: September 17, 2016, 09:06:39 pm »
Thanks Ivek,

good guidance have all changed so and it is going very well.
I also learned again what it.

A question about the script "posterswithsamename_en" the setting is so one jpg file is made with the same movie name. Could it so change: 

MovieName_Poster.jpg or

MovieName_Thumbnail.jpg

Thanks for your work

regards Jabberwocky
« Last Edit: September 17, 2016, 10:03:59 pm by Jabberwocky »
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #5 on: September 18, 2016, 09:39:27 am »
Thank you, I am glad to be edited problem.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #6 on: September 21, 2016, 03:52:24 pm »
Hallo,

I write again maybe it was overlooked,

A question about the script "posterswithsamename_en" the setting is so one jpg file is made with the same movie name. Could it so change: 

MovieName_Poster.jpg or

MovieName_Thumbnail.jpg

the original script I give this time as an annex to

Thanks for your work

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #7 on: September 22, 2016, 09:14:58 am »
Hallo,

I write again maybe it was overlooked,

A question about the script "posterswithsamename_en" the setting is so one jpg file is made with the same movie name. Could it so change: 

MovieName_Poster.jpg or

MovieName_Thumbnail.jpg

the original script I give this time as an annex to

Thanks for your work

regards Jabberwocky

Unfortunately, I have not found any solution for the script, to make the script work for the introduction of the transfer of posters in PVD.

In turn, the last PVD 1.0.2.7 version of a feature that when you press a button to " re-read file information " for a particular movie you by the poster box added any posters or pictures that you have in the movie folder (poster, thumbnail, front cover, disc(CD) and other images). Transfer all the images in the movie folder, even then, when in this folder also added there any other image folder. This is from my own adequately experienced when I was looking for solutions to the script and I was in the movie folder contains an additional folder. Further folder with images to disc and front cover has been ever since the last time I was looking for solutions to your previous application. These pictures were added to the poster box but only when the same filename as moviename. Vmovie folder may also be with such a name " 10_Things_I_Hate_About_You_R1_Custom- [cdcovers_cc] -cd1 " and will then be in the poster field.

To test and you will see the coco and then what to do.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline pelisdb

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #8 on: September 22, 2016, 03:10:34 pm »
If I have understood what you wanted, I think this should work. It's not a Poster script but a movie script that only loads the poster and cover images, as I haven't found a way to load more than one image with the poster scripts.

Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #9 on: September 22, 2016, 10:42:38 pm »
Hello,

as I wrote above, the two script run optimally. I explain myself badly.

My film folder looks like this: AnyMovie.mp4
                                          AnyMovie_Poster.jpg (Big Picture)
                                          AnyMovie_Thumbnail.jpg (screenshots)
                                          AnyMovie_Snap1.jpg (A snapshot snap1, Snap2 ...)
                                          AnyMovie_Front.jpg (Not Always)
                                          AnyMovie_Back.jpg (Not Always)
                                          AnyMovie_Cover.jpg (Not Always)

With the script "posterswithsamename_en" I can only upload the poster if his name: AnyMovie.jpg

But my pictures are made, the moviename and an appendix: _Poster       
                                                                                         _Thumbnail
                                                                                         _Snap1

therefore I need a change in the script, I understand the function in the script that the path is copied from the movie, then the file extension from AnyMovie.mp4 in AnyMovie.jpg is change,
and if this file exists is played section in the poster.

The position (poster or screenshot), I could change the script.
What I need is the function in the script not only the file extension is changed but also the Notes (as _Poster.jpg) to the path is copied added, and since I do not get ahead.

Point me to the end as follows:

1. Copy file path
2. Remove the leaves file extension
3. merge path+ _Poster
4. Insert file extension .jpg
5. Seeking file
6. if found
7. then save in Section Posters

@Ivek: The "re-read file information" option I know, but I do not want that all images you see in the Poster Section.

@pelisdb: No. I do not want a script multiple images loading, I want to with Relevant script the right image in the right section.
                e.g. Script_Poster Selects file AnyMovie_Poster.jpg and Stores in Section posters.


Hope the explanation is better. Working with a translator my English is not the best.

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline pelisdb

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #10 on: September 23, 2016, 04:36:07 am »
Hve you tried my script? It puts the movie_poster.jpg in the poster section and the movie_thumbnail.jpg in the cover section (you can easily correct the section).

Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #11 on: September 23, 2016, 11:30:27 am »
Hello pelisdb,

I overlooked your script (same sript name) apologize.

Your script is what I wanted.

My problem was I do not know where and how the Different types of images (posters, Thumbnail, front ...) defining.

z.B.  Basename := Copy(Path, 1, LastPos('.',Path)-1);
      nameposter := Basename+'_Poster.jpg';
      LogMessage('Poster: '+nameposter);

and Partial calling

z.B.   if FileExists(nameposter) then
       begin
       LogMessage('FILE EXISTS: '+nameposter);
   //nameposter :=  StringReplace(nameposter, ' ', '%20', true, false, true);
       AddImageURL(itPoster, nameposter);
       //Result := PATH;
      end else begin
      LogMessage('Poster Image not found.');
      end;

I understand the logic of the script, but with the programming language, there are problems'm learning.
If I have a template that at about that fits what I would like to do, I can change it.

As in your script the case I was able to change the different image types in the right position to load it now.
Thank you for your help, you have facilitates my work.

Nice Weekend,

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #12 on: September 23, 2016, 11:54:03 am »
Point me to the end as follows:

1. Copy file path
2. Remove the leaves file extension
3. merge path+ _Poster
4. Insert file extension .jpg
5. Seeking file
6. if found
7. then save in Section Posters

I have a way to make our work and skip the items from 2-4, where in the script to change this one piece of code
Code: [Select]
Basename := Copy(Path, 1, LastPos('.',Path)-1);
      nameposter := Basename+'_Poster.jpg';
      LogMessage('Poster: '+nameposter);
in this part of the code
Code: [Select]
Basename := Copy(Path, 1, LastPos('.',Path)-2);
      //nameposter := Basename+'_Poster.jpg';
      nameposter := Basename+'_Poster'+'.jpg';
      LogMessage('Poster: '+nameposter);

Now we pelisdb revised "posterswithsamename_en"  script is working properly.
« Last Edit: September 23, 2016, 06:58:21 pm by Ivek23 »
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21


Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #13 on: September 23, 2016, 12:08:11 pm »
Hallo again,

I thank you for the work and your Patience!!!

@Ivek

Properly Ivek the parts I missed. Logically, I knew the running, but the defination in the script was my problem.

Thanks to your help, I could change the script ready.
I'll keep my scripts when they are clean and run post here.
Perhaps they also help other users.

regards Jabberwocky

PVD - 1.0.2.7 System Win7 64Bit

Offline pelisdb

  • Member
  • *
  • Posts: 11
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #14 on: September 23, 2016, 01:46:08 pm »
I'm glad it works!

Offline Jabberwocky

  • Member
  • *
  • Posts: 9
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #15 on: September 23, 2016, 06:27:31 pm »
Hello,

As written above, I post now scripts all. Perhaps someone in the same situation as me, I was helped that I want to pass on.

It will certainly be better solutions, but for me past it.

Little explanation:

The scripts run  in a batchfile. Selectable under Plugins.
With one click all images are loaded into the proper position.

In the Info.txt, I have described my initial situation, several scenen and multiple images in a folder.
Explanation of scripts from execution and setting and naming examples.

This info is in German and English (which as I said working with translated)

Thanks to you,

regards Jabberwocky
PVD - 1.0.2.7 System Win7 64Bit

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 1899
    • View Profile
Re: Help wanted at Script -postersfolderjpg_en-
« Reply #16 on: September 25, 2016, 06:59:27 am »
Nice work, thanks.
Ivek23
Win 7 32bit, 64bit   PVD v0.9.9.21