AdvancedReportModify

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

RBasil
Posts: 14
Joined: Tue Jul 04, 2006 9:39 am

Post by RBasil »

kanski wrote:
#1. Parse the " and ' out of my titles
I don't know how remove " and ' from filenane using script.
Sorry, I should explain myself better. I'm not asking for them to be removed from the file names. I'm asking for the script to just ignore any 's or "s in the file name. Normally you can use a \ to do it in PHP and Perl. No idea how to tell the VB script to escape them (if the filename has them).

What I mean is when I tell your script to write a tracks filename to the webpage if it has a ' or a " in the filename it kills it. For example:

son'gname.mp3 prints out as just "son"
song"name.mp3 prints out as just "song"

But

songname.mp3 prints out just fine as "songname.mp3"
kanski wrote:
#2. Pull the exact filename (with a variable) out of the database?
Use 'songs.SongPath'
So this will only pull the filename of the song and not the entire path correct?
---
Robert Basil
Fallen Heroes Car
A visible remembrance of our fallen heroes.
http://www.fallenheroescar.com
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

When displaying punctation in html you should use & codes. For example:

[ ] (Space) = &nbps;
['] (Single quote) = '
["] (Double quote) = "
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
RBasil
Posts: 14
Joined: Tue Jul 04, 2006 9:39 am

Post by RBasil »

trixmoto wrote:When displaying punctation in html you should use & codes. For example:

[ ] (Space) = &nbps;
['] (Single quote) = '
["] (Double quote) = "
I understand that, but how do I tell the script to output the filename and IF it contains quotes print them as well? It is the script that is choking on the puntuation, not the html file being output.

For example here is the line of code that prints the full path to the file.
gettrack = Replace(gettrack,"<Filename>","<td>"&path&"</td>")
For example using the code above:


#1 No quotes and outputs the filename to the html.

Code: Select all

Path: c:\music\thenameofasong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
#2 Quotes and does not output the filename to the html.

Code: Select all

Path: c:\music\thename'ofasong.mpg
outputs: <td>c:\music\thename</td>
#3 Quotes and does not output the filename to the html.

Code: Select all

Path: c:\music\thename'of'asong.mpg
outputs: <td>c:\music\thename</td>
I want #2 and #3 to be able to do this instead:

Quotes and outputs the filename to the html.

Code: Select all

Path: c:\music\thename'ofasong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
Quotes and outputs the filename to the html.

Code: Select all

Path: c:\music\thename'of'asong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
Since a lot of song titles have one our more ' in them this causes a problem when trying to get the script to output the name of a file to the html.


If the filename contains any quotes then the path is only printed until the first quote and nothing after that is output to the html. But if the filename does not contain quotes then it outputs it just fine.

How do I tell them script to check for quotes in the filename and if it contains them to print them to the html?

See my problem?

I know how to do this using PHP or Perl but don't know enough about VB scripting to do it.
---
Robert Basil
Fallen Heroes Car
A visible remembrance of our fallen heroes.
http://www.fallenheroescar.com
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Try these lines of code instead...

Code: Select all

path = Replace(path,Chr(39),"&apos;")
path = Replace(path,Chr(34),""")
gettrack = Replace(gettrack,"<Filename>","<td>"&path&"</td>")
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
RBasil
Posts: 14
Joined: Tue Jul 04, 2006 9:39 am

Post by RBasil »

trixmoto wrote:Try these lines of code instead...

Code: Select all

path = Replace(path,Chr(39),"&apos;")
path = Replace(path,Chr(34),""")
gettrack = Replace(gettrack,"<Filename>","<td>"&path&"</td>")
Thanks! I'll give that a try when I get back home tomorrow. :)
---
Robert Basil
Fallen Heroes Car
A visible remembrance of our fallen heroes.
http://www.fallenheroescar.com
Guest

Post by Guest »

thanks, this script is excellent
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

Anonymous wrote:thanks, this script is excellent
:D :P :)
VPSean
Posts: 55
Joined: Tue Apr 18, 2006 11:24 pm

Post by VPSean »

Nice Script man...

Is there anyway to add "Composer" in there?

I'm wondering what would be the best way to generate a report for my me and my director.

I've been backing up my music directors music collection, which is a HUGE list of music. I wrote in the composer for everything. I've got stuff on there from Rock, Pop, Jazz, etc. But it MOSTLY consists of choral music from Baroque, Renaissance, Classical, 20th Century etc. In backing up all this music though I'm sure I have lots of discrepancies. For instance, sometimes I'm sure when I backed up the music the composer might have gone in as Bach, while other times it might have gone in as J.S. Bach, while others would be Bach, J.S. -- You know? Anyways, we're gonna have to look over my stuff and search for errors like this in the Artist Field, Album Field, and Composer field...Mainly the Artist and Composer though.

Do you have any advice as to how I might be able to do this in a good way? ANY suggestions would be REALLY appreciated.

--Sean
Edge
Posts: 6
Joined: Wed Jul 12, 2006 3:43 pm
Contact:

Post by Edge »

First of all let me say this is an awesome script! trixmoto and kanski deserve a major pat on the back for their hard work!

Is there a way the report can update when new songs are added so that only the files that are changed are produced? My problem is that if I add one album to my database and run a new report it takes me forever to upload all the files and album art to my website. It would be great if I could just add in the new info and be able to not have to worry about uploading the art that's already on there.

Even if it's not possible or can't even be added in a future version this is still a great script!

Edge

**EDIT: Oops, I see the question has already been asked. Well, at least I'm in good company then :)
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

VPSean wrote: Is there anyway to add "Composer" in there?
I'll make it in next version.
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

Edge wrote:First of all let me say this is an awesome script! trixmoto and kanski deserve a major pat on the back for their hard work!

Is there a way the report can update when new songs are added so that only the files that are changed are produced?
Thanks for warm words!

It is a difficult problem! As to solve it I do not know, but in the current version there is an opportunity to not create anew album arts if they already exist - report is generated much more quickly. I am possible in the future can partially solve a problem.

About website: it is not necessary upload all files, it is possible upload only new files and changed files:
Report folder
-alb (album files, one file - one album) Upload from here only new files.
-arti (artist file, one file - list of artist albums, compilation) Upload from here only new files.
-cap (content, one file - one cap) Full upload.
-img0 (star images, style images) it is not necessary upload
-img1 (big album arts) Upload from here only new files.
-img2 (small albums arts, exist if "Don't create image if file exist" in Optiona panel checked) Upload from here only new files.
-main (news file, art lists files) Full upload.
<report name>.htm (statistic file) Upload file

I hope my instruction will help to save a heap of time!
mikeym

!

Post by mikeym »

Hello, I had little trouble installing this (great) script, but I'd like to know how I get it to make the other pages (e.g. the New Albums one). are the html files for these pages created somewhere, because at the moment I just get a 'page not found' error.

Thanks - this is my page made with the script btw.
mikeym

Post by mikeym »

A-ha, the last post makes sense now. Maybe if it was a bit clearer that you need to upload these files also then I wouldn't have walked right into that brick wall, I'll give it another shot now!
mikeym

Post by mikeym »

All working now!

page

Love it - an option to include recent tracks/whatever via last.fm would be great also!
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

mikeym wrote:All working now!

page

Love it - an option to include recent tracks/whatever via last.fm would be great also!
GOOD!
Post Reply