imdb_rating as Stars

This is the place to post your skins, and discuss skinning

imdb_rating as Stars

Postby CiXel on Sat Mar 29, 2008 8:20 pm

I'm looking to display the imdb_rating field that looks something like this:
7.0/10

as 'stars' instead of a number.
I don't think there is a way to do this directly even in the newest version, but one of my thoughts would be to create multiple 'star' graphics, and then have them called with an if/then type variable. so if 7.0/10 then would display 7stars.jpg if 8.0/10 then would display 8stars.jpg etc...

Can anyone think of a better way to do this or is something in place that I don't know about?
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby P3rv3rt B3ar on Sun Mar 30, 2008 3:42 am

webdings or windings should work also neat. search for "casting stars" on tips and tricks forum ;)
Image
P3rv3rt B3ar
 
Posts: 1367
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: imdb_rating as Stars

Postby CiXel on Sun Mar 30, 2008 11:52 am

Thanks Perv-
I'll take a closer look at that. I came across it earlier, but it didn't seem like what I wanted to do so I only gave it a quick skim. I'll let you know how I made out.
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby CiXel on Sun Mar 30, 2008 12:51 pm

So after looking over your previous post over more in depth, http://xlobby.com/forum/viewtopic.php?f=7&t=4462&p=29330&hilit=casting+stars#p29330
I don't think it will work in this scenario.
What you are saying is, in the rating field (whatever you decide that to be), you have to set the value there to be the number of stars in wingding format ie. ««««« for 5 stars or ««««««« for 7 stars

If my rating field already looks like 7.0/10 it's obviously not going to display it correctly because it's not in wingding format.

Did I miss something?
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby P3rv3rt B3ar on Sun Mar 30, 2008 6:00 pm

no, u didnt... i just wanted to point 1 possible approach, without thinking it trough... u would need xml transform to make it work... so u prolly be better off with your original plan.
Image
P3rv3rt B3ar
 
Posts: 1367
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: imdb_rating as Stars

Postby S Pittaway on Mon Mar 31, 2008 8:12 am

i have a plugin which does it (amoung other things....)

it takes the value of "imdb rating" and creates a new field called "xdb.imdb.star.rating".

This rating is a character repeated to match the imdb rating - so 7.3/10 is converted *******

You can set this char to be a *, but it looks much nicer if you use "¶" and the wingdings font (its a nice shaded star).

If you fancy giving it a try let me now.
S Pittaway
 
Posts: 713
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: imdb_rating as Stars

Postby dalanik on Mon Mar 31, 2008 8:23 am

I did implement this with help of AMC/xAnt plugin... when exporting catalog, I just added skin://star_images/ prior to field which has 2-digit rating. and .png at the end.

All I had to do then, is create (!) 100 images :-) named star01.png, star02.png etc Well, it's actualy 5 images x 20 :-)

:)
dalanik
 
Posts: 886
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: imdb_rating as Stars

Postby CiXel on Mon Mar 31, 2008 10:46 am

S Pittaway wrote:i have a plugin which does it (amoung other things....)
it takes the value of "imdb rating" and creates a new field called "xdb.imdb.star.rating".
This rating is a character repeated to match the imdb rating - so 7.3/10 is converted *******
You can set this char to be a *, but it looks much nicer if you use "¶" and the wingdings font (its a nice shaded star).

If you fancy giving it a try let me now.

S Pittaway-
Methinks I ought to give this magical plugin a try ;)

Looks like whatever it is, it will address many issues/ideas beyond just stars.
Point me in the right direction please.
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby CiXel on Mon Mar 31, 2008 11:10 am

dalanik wrote:I did implement this with help of AMC/xAnt plugin... when exporting catalog, I just added skin://star_images/ prior to field which has 2-digit rating. and .png at the end.

All I had to do then, is create (!) 100 images :-) named star01.png, star02.png etc Well, it's actualy 5 images x 20 :-)
:)

Your method is interesting as well, and more along my original multi image idea, as it would allow for half stars or progressive star images. When it comes time to re-investigate this, I will keep it in mind as an option.
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby scottw on Mon Mar 31, 2008 1:01 pm

S Pittaway wrote:i have a plugin which does it (amoung other things....)

it takes the value of "imdb rating" and creates a new field called "xdb.imdb.star.rating".

This rating is a character repeated to match the imdb rating - so 7.3/10 is converted *******

You can set this char to be a *, but it looks much nicer if you use "¶" and the wingdings font (its a nice shaded star).

If you fancy giving it a try let me now.


I would be able to use this as well since I am now working on the movies section of my skin. If you don't mind posting it I would appreciate it as well.

Thanks!!
Scott
scottw
 
Posts: 777
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: imdb_rating as Stars

Postby S Pittaway on Mon Mar 31, 2008 1:22 pm

S Pittaway
 
Posts: 713
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: imdb_rating as Stars

Postby dalanik on Mon Mar 31, 2008 2:18 pm

scottw wrote:I would be able to use this as well since I am now working on the movies section of my skin. If you don't mind posting it I would appreciate it as well.
Thanks!!


Here is the zip file with stars. numbered 1-100, with no rating star -1 (that's how it is in AMC i think).

http://xlobby.lanik.org/stars.zip

This should go to your SKIN folder, under buttons.

And then, xant.ini should specify your template, right:
Code: Select all
[Movies]
input=d:\htpc\ant\catalogue\movies.amc
output=c:\program files\xlobby\databases\movies.xml
images=d:\htpc\ant\images\
sort=$$ITEM_ORIGINALTITLE
template=c:\program files\xlobby\plugins\moviestemplate.xml
filters=$$ITEM_BORROWER(movies)


As you can see, line:
template=c:\program files\xlobby\plugins\moviestemplate.xml

tells it to use that tamplate:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<database>
<sortorder>sorttitle</sortorder>
<sortable>
<sort>title</sort>
<sort>sorttitle</sort>
<sort>genre</sort>
<sort>director</sort>
<sort>year</sort>
<sort>starimage</sort>
<sort>name</sort>
</sortable>
<template></template>
<paths>
<path>D:\HTPC\media\movies</path>
<path>U:\HTPC\media\movies</path>
<path>V:\HTPC\media\movies</path>
<path>W:\HTPC\media\movies</path>
</paths>
<item>
<parameter>$$ITEM_URL</parameter>
<coverart>$$ITEM_PICTUREFILENAME</coverart>
<display>$$ITEM_ORIGINALTITLE</display>
<offline>$$ITEM_SOURCE</offline>
<information>
<name>$$ITEM_ORIGINALTITLE</name>
<title>$$ITEM_ORIGINALTITLE</title>
<sorttitle>$$ITEM_ORIGINALTITLE</sorttitle>
<director>$$ITEM_DIRECTOR</director>
<runtime>$$ITEM_LENGTH</runtime>
<plot>$$ITEM_DESCRIPTION</plot>
<actors>$$ITEM_ACTORS</actors>
<year>$$ITEM_YEAR</year>
<genre>$$ITEM_CATEGORY</genre>
<starimage>skin://buttons/stars/star$$ITEM_RATING.png</starimage>
<off>$$ITEM_SOURCE</off>
<medianr>$$ITEM_MEDIA</medianr>
<videoformat>$$ITEM_VIDEOFORMAT</videoformat>
<videobitrate>$$ITEM_VIDEOBITRATE</videobitrate>
<audioformat>$$ITEM_AUDIOFORMAT</audioformat>
<audiobitrate>$$ITEM_AUDIOBITRATE</audiobitrate>
<resolution>$$ITEM_RESOLUTION</resolution>
<framerate>$$ITEM_FRAMERATE</framerate>
<languages>$$ITEM_LANGUAGES</languages>
<subtitles>$$ITEM_SUBTITLES</subtitles>
</information>
</item>
</database>


This is my template, and the line that is important is

<starimage>skin://buttons/stars/star$$ITEM_RATING.png</starimage>

It makes <starimage> field in the database which points to the image in skin folder....

D.
dalanik
 
Posts: 886
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: imdb_rating as Stars

Postby CiXel on Mon Mar 31, 2008 2:41 pm



Wow... That's quite an amazingly comprehensive manipulation device :D
Thank you for sharing and for having such verbose documentation and examples.

Now I just have to figure out how to weed my way through and make it do what I need.
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby CiXel on Mon Mar 31, 2008 2:47 pm

dalanik wrote:Here is the zip file with stars. numbered 1-100, with no rating star -1 (that's how it is in AMC i think).
http://xlobby.lanik.org/stars.zip

This is my template, and the line that is important is
<starimage>skin://buttons/stars/star$$ITEM_RATING.png</starimage>
It makes <starimage> field in the database which points to the image in skin folder....

Hmm... I like this too. I'm feeling an eventual hybrid in the works where you could parse the DB with S Pittaway's tool and then call the separate graphics with dalanik's skin idea. I think I'll work on just getting ONE to work in the short term... but I'm all excited for this again as I rebuild XL again. Reminds me of the old days ;) Thanks for all your input.
CiXel
 
Posts: 181
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: imdb_rating as Stars

Postby S Pittaway on Mon Mar 31, 2008 5:11 pm

if you dont mind coding (or waiting till i get round to it:)) its easy enuff to get the pluging to use images instead of a rating character

in the code i use imdb.rating = no of chars, its easy to change it to use imdb.rating = image path + (no of chars) + ".jpg", its probably just a few lines of code.

For me the wingding star character is fine and i don't really care about the decimal point on the rating (6.7 = 7 to me :))
S Pittaway
 
Posts: 713
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Next

Return to Skins

Who is online

Users browsing this forum: No registered users and 1 guest

cron