Posted by: Ivek23
« on: September 25, 2016, 06:59:27 am »Nice work, thanks.
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
Basename := Copy(Path, 1, LastPos('.',Path)-1);
nameposter := Basename+'_Poster.jpg';
LogMessage('Poster: '+nameposter);
in this part of the codeBasename := Copy(Path, 1, LastPos('.',Path)-2);
//nameposter := Basename+'_Poster.jpg';
nameposter := Basename+'_Poster'+'.jpg';
LogMessage('Poster: '+nameposter);
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
Question One: Why is this script hanging?
Question Two: What changes should I make where the command "function GetCoverType: smallint;"
function GetCoverType: Byte;
function GetCoverType : Byte; // 0 - front cover, 1 - disc image
// 0 - Front, 1 - CD
Begin
Result := 1;
Inc (CoverType);
End;
//Global variables
var
Mode : Byte;
CoverType: Integer;
and//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;
// ! 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.