![](/images/MasterShadowLeftTop.gif) |
|
Welcome to the Invelos forums. Please read the forum
rules before posting.
Read access to our public forums is open to everyone. To post messages, a free
registration is required.
If you have an Invelos account, sign in to post.
|
|
|
|
Invelos Forums->DVD Profiler: Plugins |
Page:
1 2 3 4 5 ...8 Previous Next
|
New Plugin: DVDProfileLoop - send profile data to scripts (.bat, .exe) |
|
|
|
Author |
Message |
Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | @Dedcap: Simply amazing. I believe you meant to say "HTML" not email, right? Anyway, I tried it and I got a nice HTML report with a search bar. Cool. If you can't make a screen shot, I will - let me know - so people can see how cool it is. Anyway, a couple of things: (1) Change RunningTime to RunTime and the automatic parameter function will pick it up (2) I found a bug that prevents CountryOfOrigin from being picked up - I will fix in the next release (3) I was trying to make changes that would allow automatic copying of the thumbnails, as in the original smartphone script. Still didn't quite get there - that "shift" business is tricky. Clever how you did that. Anyway, an impressive piece of work! ![](/images/emoticons/smile.gif) | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. |
| Registered: March 14, 2007 | Posts: 159 |
| Posted: | | | | Yes, I'm sorry, didn't know where my mind was when I write this, I fix it, thanks It'll help me if you could put the screen shot, thanks (2) ok, I will retrieve it when available, thanks (3) the shift part was a little bit tricky, the strange thing that audio track and subtitle are not manage in the same way Thanks for your comment, so many thing to do again ![](/images/emoticons/tongue_smilie.gif) |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | Quoting Dedcap: Quote: Yes, I'm sorry, didn't know where my mind was when I write this, I fix it, thanks It'll help me if you could put the screen shot, thanks
(2) ok, I will retrieve it when available, thanks (3) the shift part was a little bit tricky, the strange thing that audio track and subtitle are not manage in the same way
Thanks for your comment, so many thing to do again ![](/images/emoticons/tongue_smilie.gif) The difference was not intentional. I had problems trying figure out how to handle database fields that could have multiple values - whether to pass the field as a single comma delimited string, or as multiple tokens. What do you suggest? I will fix it - I don't think so many people are using this feature, so you can get what you want. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. |
| Registered: March 15, 2007 | Posts: 366 |
| Posted: | | | | A bunch of my thumbnails are missing when I tried this using the smartphone file. I can't figure out what the connection is because I don't notice nay pattern. |
| Registered: March 14, 2007 | Posts: 159 |
| Posted: | | | | do you mean that some thumbnail are copy into the specific folder and some not ? i remember that for copying, it use the id (3566566...) did you check manually if the missing thumbnails are present in the dvd profiler folder with the right id ?
sorry for my english |
| Registered: March 14, 2007 | Posts: 159 |
| Posted: | | | | Quoting mediadogg: Quote:
The difference was not intentional. I had problems trying figure out how to handle database fields that could have multiple values - whether to pass the field as a single comma delimited string, or as multiple tokens. What do you suggest? I will fix it - I don't think so many people are using this feature, so you can get what you want.
it's hard to reply because it really depends of the usage, for my script it would be best to have only one field |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | Quoting nolesrule: Quote: A bunch of my thumbnails are missing when I tried this using the smartphone file. I can't figure out what the connection is because I don't notice nay pattern. A bit of confusion here: there is an "official" Smartphone script that comes with the plugin. And there is a more advanced one from Dedcap. To be clear what we are talking about, can we call them Smartphone and Smartphone+ or something like that? Now, which one did you mean? Ha ha ! ![](/images/emoticons/laugh.gif) Dedcap, correct me if I'm wrong, but I thnk your Smartphone+ does not copy the thumbnails, right? (I'm working on a plugin fix that will make it easier for you to do that). But the original Smartphone script - it should work. But yes, as Dedcap says, it can only copy them if they are there. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
| Registered: March 14, 2007 | Posts: 159 |
| Posted: | | | | yes that's true, mine does not copy thumbnails |
| Registered: March 15, 2007 | Posts: 366 |
| Posted: | | | | Yeah, I'm using the one that comes with. Looking at the text from the thumbnail copy, it's acting like the images do not exist, but they do. |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | Quoting nolesrule: Quote: Yeah, I'm using the one that comes with. Looking at the text from the thumbnail copy, it's acting like the images do not exist, but they do. Let's see, I'm trying t figure out how to debug this ... One thing I noticed - sometimes for some reason, the "smartphone" folder gets created in the main DVDProfiler folder instead of under plugins\dvdprofileloop. I never figured out why. So, you could try (1) look there to see if it got created there or (2) recode the script to put the directory somewhere easy to find such as c:\smartphone\". I usually erase the old copy bfore running the new one, just to make sure I'm looking at the one I just created - in case it gets put somewhere else due to that bug I just mentioned. If it doesn't show up where I expect it to, I start looking in the DVDPro folder. Oh, also check to see if the copyfiles,bat got created correctly. If so, then it means there is a bug that prevents the call to copyfiles from working. If copyfiles.bat is there, just run it manually - it should copy the files. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
| Registered: March 15, 2007 | Posts: 366 |
| Posted: | | | | It seems that the bug may be in generating the copyfiles.bat file. for the unsuccessful entries, I'm getting lines that don't have a source file. Instead, they are being replaced with some random data. Just a couple of examples...
copy Owned .\smartphone\thumbnails\ copy "Wish List" .\smartphone\thumbnails\ copy 1995' .\smartphone\thumbnails\ copy Pixar .\smartphone\thumbnails\
I believe that the last 2 are being pulled from tags. And all the ones that show a year in the source file have the single quote after the number. |
| Registered: March 15, 2007 | Posts: 366 |
| Posted: | | | | OK, I think I figured out the cause of the issue. I ran a preview and noticed that the DVDs where the cover images didn't copy over did not contain double quotes around the tag strings. And this only occured when the tag string was 'Year','xxxx' where xxxx is a 4 digit year. If there were any additional tags set or even no tags set, this didn't occur. |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | Quoting nolesrule: Quote: OK, I think I figured out the cause of the issue. I ran a preview and noticed that the DVDs where the cover images didn't copy over did not contain double quotes around the tag strings. And this only occured when the tag string was 'Year','xxxx' where xxxx is a 4 digit year. If there were any additional tags set or even no tags set, this didn't occur. Sorry, I missed this post earlier. Thanks for that diagnosis. I got my self into trouble trying to handle .BAT files. The legacy of DOS makes handling of parameters with embedded blanks or quotes a problem. I have some heuristics built in to try and decide when or whether to bracket the parameters with single quotes or double quotes or not at all. I never considered a tag actually having a quote embedded. I'll see what I can do about it. The rules are (I think): - if no embedded blanks or double quotes or single quotes, pass a single parameter as an unquoted string - if no embedded blanks or double quotes or single quotes, pass a multi-valued parameter as a quoted string with the values separated by commas (not sure - maybe they all have single quotes)) - if embedded blanks, use double quotes, unless the string contains double quotes, in which case, convert the embedded double quotes to single quotes first - parameters with multiple values such as genre, event dates like watched, watched by, tags, etc. are passed as a quoted string with value separated by commas. Tags with embedded quotes were not expected, so I don't convert them to single quotes, causing the .BAT file to see crazy things depending on where the tag falls in the string (a quote mark will terminate the string and start a new parameter where one was not expected). If it is convenient, you could test my theory by changing one of your quoted tags to use single quotes instead. If that fixes things then I will know how to fix my code in the next release. Oops, now I see that you are using single quotes ... so I need to explore further .... | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
| Registered: March 15, 2007 | Posts: 366 |
| Posted: | | | | I don't have any quotes in my tags. I was just giving an example of the preview output.
I found it occured with another set of tags, as well....'Disney','Animated','Features'. I thought it might be occuring in profiles with only a single parent tag chosen, but that's not the case. Still, all tags have single quotes, with each one separated by comma, so if there are commas in the string out side of single quotes, there needs to be double quotes around the whole thing.
As for where the files are being created, I think I may have noticed a pattern. I think it generates the files in the folder path of the last file dialogue box that is opened. I just ran the script and it created everything in "My Documents/DVD Profiler/Flags/smartphone", and the only thing I did before running the script was load a flag file from that directory. And when I switch batch files to run for the program, it creates it in the plugin directory. | | | Last edited: by nolesrule |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | @nolesrule
You rule! Thanks. I'll start working on some improvements.
BTW, although this has been a great exercise to help me debug my plugin, the best solution for Smartphone might be to tale tlevel up on his offer to modify iPod Exporter to support Smartphones. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
| Registered: March 18, 2007 | Reputation: ![Highest Rating](/images/Ratings/Small/4.png) | Posts: 6,449 |
| Posted: | | | | DVDProfileLoop 1.4 Available:
Mostly maintenance - Fixed auto recognization of CountryOfOrigin - Added outside double quotes to parameters with multiple single-quoted values - Fixed errors in data retrieval for features categories
These fixes should enable "Dedcap" and "nolesrule" to complete their scripts.
Here is my updated "Smartphone - enhanced" script of dedcap. I modified it to copy the thumbnails also:
@echo off Rem Creates simple HTML files that should be compatible with most smartphones Rem Uses folder {dvdpro}\plugins\dvdprofileloop\smartphone
Rem You must check Rem runcode, profileID, title, rating, Rem ProductionYear, CountryOfOrigin, RunningTime, AudioTracks, Subtitles, LoanedTo
Rem In that case: Rem %1 = runcode (1 = start, 0 = run, 2 = finish) Rem %2 = Profile ID Rem %3 = title Rem %4 = Rating Rem %5 = ProductionYear Rem %6 = CountryOfOrigin Rem %7 = RunTime Rem %8 = AudioTracks Rem %9 = Subtitles Rem %10 = LoanedTo Rem %11 = ThumbNailFront Path
set runcode=%1 set id=%2 set title=%3 set rate=%4 set prodYear=%5 set country=%6 set duration=%7 set audio=%8 set subtitles=%9
if %runcode% ==1 goto BEGIN if %runcode% ==0 goto RUN if %runcode% ==2 goto FINISH goto OUT
:BEGIN if not exist smartphone md smartphone if not exist "smartphone\thumbnails" md "smartphone\thumbnails" echo @echo off 1>copyfiles.bat echo ^<html^> 1>".\smartphone\index.html" echo ^<head^> 1>>".\smartphone\index.html" echo ^<title^>DVDProfiler Collection^</title^> 1>>".\smartphone\index.html"
echo ^<script language="JavaScript"^> 1>>".\smartphone\index.html" echo ^<!-- Original by http://javascript.internet.com More javascripts http://www.hypergurl.com --^> 1>>".\smartphone\index.html" echo var NS4 = (document.layers); // Which browser? 1>>".\smartphone\index.html" echo var IE4 = (document.all); 1>>".\smartphone\index.html" echo var win = window; // window to search. 1>>".\smartphone\index.html" echo var n = 0; 1>>".\smartphone\index.html" echo function findInPage(str) { 1>>".\smartphone\index.html" echo var txt, i, found; 1>>".\smartphone\index.html" echo if (str == "") return false; // Find next occurance of the given string on the page, wrap around to the 1>>".\smartphone\index.html" echo // start of the page if necessary. 1>>".\smartphone\index.html" echo if (NS4) { 1>>".\smartphone\index.html" echo // Look for match starting at the current point. If not found, rewind 1>>".\smartphone\index.html" echo // back to the first match. 1>>".\smartphone\index.html" echo if (!win.find(str)) while(win.find(str, false, true)) 1>>".\smartphone\index.html" echo n++; else n++; // If not found in either direction, give message. 1>>".\smartphone\index.html" echo if (n == 0) alert("Not found."); 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo if (IE4) { 1>>".\smartphone\index.html" echo txt = win.document.body.createTextRange(); 1>>".\smartphone\index.html" echo // Find the nth match from the top of the page. 1>>".\smartphone\index.html" echo for (i = 0; i ^<= n ^&^& (found = txt.findText(str)) != false; i++) { 1>>".\smartphone\index.html" echo txt.moveStart("character", 1); 1>>".\smartphone\index.html" echo txt.moveEnd("textedit"); 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo // If found, mark it and scroll it into view. 1>>".\smartphone\index.html" echo if (found) { 1>>".\smartphone\index.html" echo txt.moveStart("character", -1); 1>>".\smartphone\index.html" echo txt.findText(str); 1>>".\smartphone\index.html" echo txt.select(); 1>>".\smartphone\index.html" echo txt.scrollIntoView(); 1>>".\smartphone\index.html" echo n++; 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo // Otherwise, start over at the top of the page and find first match. 1>>".\smartphone\index.html" echo else { 1>>".\smartphone\index.html" echo if (n ^> 0) { 1>>".\smartphone\index.html" echo n = 0; 1>>".\smartphone\index.html" echo findInPage(str); 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo // Not found anywhere, give message. else alert("Not found."); 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo return false; 1>>".\smartphone\index.html" echo } 1>>".\smartphone\index.html" echo ^</script^> 1>>".\smartphone\index.html"
echo ^</head^> 1>>".\smartphone\index.html" echo ^<body^> 1>>".\smartphone\index.html"
Rem First Do Owned echo ^<h4^>DVD Profiler Collection^</h4^> 1>>".\smartphone\index.html" echo ^<HR^> 1>>".\smartphone\index.html"
echo ^<form name="search" onSubmit="return findInPage(this.string.value);"^> 1>>".\smartphone\index.html" echo ^<div align="center"^> ^<p^>^<font size=3^> ^<input name="string" type="text" size=15 onChange="n = 0;"^> ^</font^> 1>>".\smartphone\index.html" echo ^<input type="submit" value="Search Page"^> ^</p^> ^</div^> 1>>".\smartphone\index.html" echo ^</form^> 1>>".\smartphone\index.html" echo ^<HR^> 1>>".\smartphone\index.html"
echo ^<table border="1" width="700"^> 1>>".\smartphone\index.html"
goto OUT
:RUN
:BEGINSHIFT set subtitles=%9 shift set loaned=%9 shift set thumbnails=%9
:ENDSHIFT echo copy %thumbnails% .\smartphone\thumbnails\%id%f.jpg 1>>copyfiles.bat echo ^<tr^>^<td^>^<img src=".\thumbnails\%id%f.jpg" width="70" height="105" align="top"^>^</td^> 1>>".\smartphone\index.html" echo ^<td^>^<table border="1" width="700"^> 1>>".\smartphone\index.html" echo ^<tr^>^<td^>^<b^>%title%^</b^> (%id%) ^</td^>^</tr^> 1>>".\smartphone\index.html" echo ^<tr^>^<td^>^<table border="1" width="700"^> 1>>".\smartphone\index.html" echo ^<tr^>^<td width="140"^>%prodYear%^</td^>^<td width="140"^>%country%^</td^>^<td width="140"^>%duration% min^</td^>^<td width="140"^>Rated : %rate%^</td^>^<td ^>Pret: %loaned%^</td^>^</tr^> 1>>".\smartphone\index.html" echo ^</table^>^</td^>^</tr^> 1>>".\smartphone\index.html" echo ^<tr^>^<td^>^<table^> 1>>".\smartphone\index.html" echo ^<tr^>^<td^>Langue :^</td^>^<td^>%audio%^</td^>^</tr^> 1>>".\smartphone\index.html" echo ^<tr^>^<td^>Sous-titres:^</td^>^<td^>%subtitles%^</td^>^</tr^> 1>>".\smartphone\index.html"
echo ^</table^>^</td^>^</tr^> 1>>".\smartphone\index.html" echo ^</table^>^</td^> 1>>".\smartphone\index.html"
echo ^</tr^> 1>>".\smartphone\index.html" goto OUT
:FINISH echo ^</table^> 1>>".\smartphone\index.html" echo ^</body^> 1>>".\smartphone\index.html" echo ^</html^> 1>>".\smartphone\index.html" call copyfiles.bat :OUT
@dedcap This is a really clever script. The search capability is most cool. @nolesrule Thanks for helping me find that quoted string error. It was also affecting dedcap's script
Another way to vastly simplify this script:
Since nothing in the BEGIN section actually depends on the data, I would put the whole preamble in a "header" file and just copy it over. Something like this (adjust paths as necessary):
BEGIN if not exist smartphone md smartphone if not exist "smartphone\thumbnails" md "smartphone\thumbnails" echo @echo off 1>copyfiles.bat copy indexheader.html smartphone\index.html goto OUT
Now the rest of the script will be exactly the same. Should be easier to read and debug. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. | | | Last edited: by mediadogg |
|
|
Invelos Forums->DVD Profiler: Plugins |
Page:
1 2 3 4 5 ...8 Previous Next
|
|
|
|
|
|
|
|
![](/images/MasterShadowRightTop.gif) |