MyList Export Templates

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

You can make one yourself. :P
It's quite easy to be based on any current style.
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

yes, it's easy..
there are ways to reduce the size of the exports, dynamic use of script, use less vars, smaller var names, use of css stylesheets, etc.
make one yourself, you can download the sdk, look at exports there, read the docs (that on the last version were more informative :), and ask questions arround the dev forum.
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

A little addendum to the Template How To to reflect recent changes:

(this is valid for version 0.1.00dev of anidb and SDK 0.9)

For data_ep_state
#EP_SPECIAL=1, EP_RECAP=2, EP_OP=4, EP_END=8, EP_???=16, EP_TRAILER=32, EP_PARODY=64, EP_OTHER=128

Notes:
Ep state 4 is now favored against ep state 8, for credits/endings/openings.
Ep state 16 is currently not used.
Any ep data_ep_state with state+2 is a recap.
Any ep with data_ep_state > 1 is a special.

So a episode with state 66 is a Paradoy Episode which in turn is a Recap.
(default data_ep_state is 0)
(in case this was unnoticed)

As for data_ep_epno:
- for normal episodes outputs : X
- for special episodes outputs: SX
- for credit episodes outputs: S10X
- for trailler episodes outputs: S20X
- for parody episodes outputs: S30X
- for other episodes outputs: S90X

This poses a problem, as its impossible to distinguish from a normal special with episode number 101 (S101) from a credit episode with number 1 (S101), so if you are planning to use the episode number in your templates i would sugest using this hack, until exp changes things internaly or does this automaticaly at export time, server-side.

Note, this hack is ugly like hell, but it works.. likewise this is what i made for my templates (javascript based) if you use something diferent, adapt:

Code: Select all

e<tmpl_var name=data_ep_epno>.num = "<tmpl_if expr="(data_ep_state == 0)"><tmpl_var name=data_ep_epno></tmpl_if><tmpl_if expr="(data_ep_state == 1) || (data_ep_state == 2)">S<tmpl_var expr="substr( data_ep_epno , 1 )"></tmpl_if><tmpl_if expr="(data_ep_state == 4) || (data_ep_state == 6)">C<tmpl_var expr="substr( data_ep_epno , 3 )"></tmpl_if><tmpl_if expr="(data_ep_state == 16) || (data_ep_state == 18)"><tmpl_var name=data_ep_epno></tmpl_if><tmpl_if expr="(data_ep_state == 32) || (data_ep_state == 34)">T<tmpl_var expr="substr( data_ep_epno , 3 )"></tmpl_if><tmpl_if expr="(data_ep_state == 64) || (data_ep_state == 66)">P<tmpl_var expr="substr( data_ep_epno , 3 )"></tmpl_if><tmpl_if expr="(data_ep_state == 128) || (data_ep_state == 130)">O<tmpl_var expr="substr( data_ep_epno , 3 )"></tmpl_if>"
This converts the epno in the current anidb implementation, and note that i still use data_ep_state = 16/18, because it's still used (at least in the SDK).

This was made on an informative base, but also to bug exp to release an updated SDK :P

(if i find more stuff i'll add it to this post)
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

made a very little update to the SDK,
this is NOT the big overhaul a lot of you are waiting for, sorry :|

and little correction, a file with ep type=2 is not a special! (so not all >=1 are specials)

BYe!
EXP
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

small update to the SDK.
still very untested, so bugs are expected.

this is also still not the big update you're waiting for, but at least some more data is in now.
i am not sure if full stream info will ever be added, it's just too performance eating @ export generation.

BYe!
EXP
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

I'm having this error while making the example output and don't have the single idea why it happens. :(
Parsing template[html-lightblue]:
* cleaning output directory... done.
* parsing mylist.tpl...ERROR: Storable binary image v2.7 more recent than I am
(v2.6) at blib\lib\Storable.pm (autosplit into blib\lib\auto\Storable\_retrieve.
al) line 323.
Using Perl 5.8.6.811 and replaced the files requested by the SDK. :/
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

DonGato wrote:I'm having this error while making the example output and don't have the single idea why it happens. :(
Parsing template[html-lightblue]:
* cleaning output directory... done.
* parsing mylist.tpl...ERROR: Storable binary image v2.7 more recent than I am
(v2.6) at blib\lib\Storable.pm (autosplit into blib\lib\auto\Storable\_retrieve.
al) line 323.
Using Perl 5.8.6.811 and replaced the files requested by the SDK. :/
Also got the same problem, solved by fetching latest version of Storable with CPAN
linux wrote:Start CPAN and type:

Code: Select all

install Storable
Windows wrote:Start PPM and type:

Code: Select all

install Storable
(instructions for windows are guessed, but should work never the less)
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

ppm> Install Storable
Error: Package 'Storable' not found. Please 'search' for it first.
I hate this crap...
ppm> Search Storable
Searching in Active Repositories
1. Tie-StorableDir [0.075] Perl extension for tying directories with Storabl~
2. Tie-StorableDir [0.075] Tie-StorableDir
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

DonGato wrote:
ppm> Install Storable
Error: Package 'Storable' not found. Please 'search' for it first.
I hate this crap...
ppm> Search Storable
Searching in Active Repositories
1. Tie-StorableDir [0.075] Perl extension for tying directories with Storabl~
2. Tie-StorableDir [0.075] Tie-StorableDir
crap, didn't know that...

you can alternatively install perl trough CPAN in windows, read this

never the less i'll try to work this out on my windows box..

Edit: Don Gato, try installing perl 5.8.8 from active state, i'm guessing that their version of Storable is the one needed with the current sdk, because the export worked fine in my windows box.
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

Yes, at last I made it work. :P
Now I don't understand shit about the changes.
What was exactly added (not, the small readme log doesn't help much)?
Some values were removed? Which ones?
Which values replaced which?

Maybe I should drop the style...
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

DonGato wrote:Yes, at last I made it work. :P
Now I don't understand shit about the changes.
What was exactly added (not, the small readme log doesn't help much)?
Some values were removed? Which ones?
Which values replaced which?

Maybe I should drop the style...
well, from what i found out:

"data_file_res_id", get rid of this var on your anime.tpl, it will probably fsk every thing, well to me it fsk everything :P

other than that, the new global vars don't get exported, because exp forgot to add them to one of the files, but they seem very self explanatory.
you got have the table of ids and names of the company types and aptype because exp forgot to add that..
tags are prety much useless, but we can add a search beaviour for them... but i don't see much reason why..

as for what is exported, well exp fixed things so that almost everything that got exported before (less 2nd audio and sub streams) still gets exported.

here's my version of the changelog:
changelog wrote:

Code: Select all

 0.10 - 30.04.2006

    - fixed file data (only 1. vid and 1&2. aud&sub stream data available)

    - new fields 
    	FILE: 
    		data_file_type, 					(int)		# file type (see ids.txt)
    		data_file_vidcnt, 					(int)		# number of video streams
    		data_file_ar, 						(int)		# aspect ratio id (see ids.txt)
    		data_file_fps, 						(int)		# frames per second
    		data_file_vflags,					(string?)	# video flags ?

    		data_file_audcnt, 					(int)		# number of audio streams
    		data_file_chantype, 				(int)		# number of channels for aud stream2 (see ids.txt)
    		data_file_abitrate2, 				(int)		# audio bitrate for aud stream2
    		data_file_acodec_id2, 				(int)		# audio codec for aud stream2
    		data_file_acodec_name2, 			(string)	# audio codec name for aud stream2
    		data_file_chantype2, 				(int)		# number of channels for aud stream1
    		data_file_lang_id2, 				(int)		# audio language id for aud stream2
    		data_file_lang_name2, 				(int)		# audio language name for aud stream
    		data_file_subcnt, 					(int)		# number of subtitle streams
    		data_file_sflags, 					(string?)	# subtitle flags?
    		data_file_stype, 					(int)		# subtitle subtitle type (see ids.txt)
    		data_file_sub_id2, 					(int)		# subtitle stream2 id
    		data_file_sub_name2, 				(string)	# subtitle stream2 name
    		data_file_sflags2, 					(string?)	# subtitle stream2 flags
    		data_file_stype2, 					(int)		# subtitle stream2 type
    		data_file_length					(int) 		# file lenght in seconds

    	ANIME: 
    		data_anime_annid,					(int)		# ann id
    		status_anime_ann_listed, 			(boolean)	# is ann listed
    		data_anime_annurl, 					(string)	# ann url
    		data_anime_allcinemaid, 			(int)		# allcinema id
    		status_anime_allcinema_listed, 		(boolean)	# is allcinema listed
    		data_anime_allcinemaurl, 			(string)	# allcinema url
    		## Categories, sorting should be done by parent Ids.
    		loop_anime_genren,
    			data_anime_genren_id, 			(int)		# id of the cat
    			data_anime_genren_name, 		(string)	# name of the cat
    			data_anime_genren_parentid, 	(string)	# parent id of the cat (root = 1)
    			data_anime_genren_ishentai, 	(boolean)	# is cat hentai ?
			## Tags (no actual usage, but in export we could search this?)
    		loop_anime_tag, 
    			data_anime_tag_id, 				(int)		# tag id
    			data_anime_tag_name, 			(string)	# tag name
    			data_anime_tag_date, 			(string)	# tag date
    		## Producers
    		loop_anime_company, 
    			data_anime_company_id, 			(int)		# company id
    			data_anime_company_name, 		(string)	# company name
    			data_anime_company_shortname, 	(string)	# company shortname
    			data_anime_company_othername, 	(string)	# company othername
    			data_anime_company_type, 		(string)	# company type (see ids.txt)
    			data_anime_company_url, 		(string)	# company url
    			data_anime_company_picurl, 		(string)	# company picurl
    			data_anime_company_aptype		(string)	# company type of work in this anime (see ids.txt)

    	GLOBAL: 
    		global_userstat_animeadded, 		(int)		# total animes added
    		global_userstat_epsadded, 			(int)		# total episodes added
    		global_userstat_filesadded, 		(int)		# total files added
    		global_userstat_groupsadded, 		(int)		# total groups added
    		global_userstat_lamefiles, 			(int)		# total number of lame files
    		global_userstat_lamefilesp, 		(int)		# percentage of lame files ?
    		global_userstat_independencep, 		(int)		# independence percentage ?
    		global_userstat_leechp,				(int)		# leech percentage ?
    		global_userstat_reviews, 			(int)		# number of reviews
    		global_userstat_votes, 				(int)		# total number of votes
    		global_userstat_totalviewedp, 		(int)		# percentage of total viewed eps ?
    		global_userstat_totalownedp, 		(int)		# percentage of total owned eps ?
    		global_userstat_ownviewedp, 		(int)		# percentage of total owned viewed eps ?
    		global_userstat_viewedepcnt 		(int)		# total viewed episode count ?
and here is my updated version of all ids in usage as of today.

also here's an update tar of all the audio and sub flag images .

these are all the currently exported vars, with examples for .hack//SIGN, as per datadump file info.

Edit: as for video and subtitle flags, i know what they are, but i don't know the relation between the checkboxes and what we get on the export, i supose it's some kind of bit type thingie, but what the bits mean, i have no fkg ideia..

Edit2: Forget that, figured the flags, check the updated ids.txt file...
(slow and painful process of make creqs and revoking them to see raw data...)
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

Before anything thanks for the help as it wasn't much understandable the little written in the changelog, besides all the other documentation is not updated and misleading at times.

Some problems:

Missing images (audio/subs):
finish
chinese (mandarin)
chinese (cantonese)
other
tatar

The forged data has the wrong AniDB URL (old one) so it's a pain to check some features of the template.

I don't see much use for streams for now. Is the old behavior still kept? I mean, old variables are still used and filled with the main stream?
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

DonGato wrote:Before anything thanks for the help as it wasn't much understandable the little written in the changelog, besides all the other documentation is not updated and misleading at times.

Some problems:

Missing images (audio/subs):
finish
chinese (mandarin)
chinese (cantonese)
other
tatar

The forged data has the wrong AniDB URL (old one) so it's a pain to check some features of the template.

I don't see much use for streams for now. Is the old behavior still kept? I mean, old variables are still used and filled with the main stream?
as for missing images, i simply downloaded the pics acording to the names, i think that mandarin and cantonese use the the chinese flag, as for the other flags, i have no ideia and no access to the ftp server to download them, maybe they don't exist?

as for the anidb url, that one is easy, just open up export/export.pm in your favorite text editor, and replace this var:

Code: Select all

$tpl->param("global_animedburl" => "http://anidb.ath.cx/perl-bin/animedb.pl");
with

Code: Select all

    $tpl->param("global_animedburl" => "http://anidb.info/");
    $tpl->param("global_userstat_animeadded" => "1");
    $tpl->param("global_userstat_epsadded" => "3");
    $tpl->param("global_userstat_filesadded" => "169");
    $tpl->param("global_userstat_groupsadded" => "1");
    $tpl->param("global_userstat_lamefiles" => "0");
    $tpl->param("global_userstat_lamefilesp" => "0%");
    $tpl->param("global_userstat_independencep" => "3%");
    $tpl->param("global_userstat_leechp" => "97%");
    $tpl->param("global_userstat_reviews" => "1");
    $tpl->param("global_userstat_votes" => "171");
    $tpl->param("global_userstat_totalviewedp" => "6%");
    $tpl->param("global_userstat_totalownedp" => "13%");
    $tpl->param("global_userstat_ownviewedp" => "49%");
    $tpl->param("global_userstat_viewedepcnt" => "3072");
As for the independece and leech percentage, they are the reverse of one another (DerIdiot pointed me to the Wiki :P), note that i don't actualy know if percentage are outputed with the percentage sign or are just int's.
It doens't hurt using the new address style for things "http://anidb.info/a222"...

As for the old behaviour, it works almost the same, exp took care of it, except for dual audio files, because ids 10~14 got dumped..

in my new revision of the anime.tpl i use this:

Code: Select all

// Video Streams
f<tmpl_var name=data_file_id>.videoCnt = "<tmpl_var name=data_file_vidcnt>";
f<tmpl_var name=data_file_id>.video = new Array();
<tmpl_if expr="data_file_vidcnt > 0">f<tmpl_var name=data_file_id>.video[0] = new Object();
f<tmpl_var name=data_file_id>.video[0].Res = "<tmpl_var name=data_file_res_name>";
f<tmpl_var name=data_file_id>.video[0].Br = <tmpl_var name=data_file_vbitrate>;
f<tmpl_var name=data_file_id>.video[0].CodecID = <tmpl_var name=data_file_vcodec_id>;
f<tmpl_var name=data_file_id>.video[0].CodecName = "<tmpl_var name=data_file_vcodec_name>";
f<tmpl_var name=data_file_id>.video[0].AR = <tmpl_var name=data_file_ar>;
f<tmpl_var name=data_file_id>.video[0].FPS = <tmpl_var name=data_file_fps>;
f<tmpl_var name=data_file_id>.video[0].Flags = <tmpl_var name=data_file_vflags>;</tmpl_if>
// Audio Streams
f<tmpl_var name=data_file_id>.audioCnt = "<tmpl_var name=data_file_audcnt>";
f<tmpl_var name=data_file_id>.audio = new Array();

<tmpl_if expr="data_file_audcnt > 0">f<tmpl_var name=data_file_id>.audio[0] = new Object();
f<tmpl_var name=data_file_id>.audio[0].Br = <tmpl_var name=data_file_abitrate>;
f<tmpl_var name=data_file_id>.audio[0].CodecID = <tmpl_var name=data_file_acodec_id>;
f<tmpl_var name=data_file_id>.audio[0].CodecName = "<tmpl_var name=data_file_acodec_name>";
f<tmpl_var name=data_file_id>.audio[0].ChanType = <tmpl_var name=data_file_chantype>;
f<tmpl_var name=data_file_id>.audio[0].langID = <tmpl_var name=data_file_lang_id>;
f<tmpl_var name=data_file_id>.audio[0].langName = "<tmpl_var name=data_file_lang_name>";</tmpl_if>
<tmpl_if expr="data_file_audcnt > 1">f<tmpl_var name=data_file_id>.audio[1] = new Object();
f<tmpl_var name=data_file_id>.audio[1].Br = <tmpl_var name=data_file_abitrate2>;
f<tmpl_var name=data_file_id>.audio[1].CodecID = <tmpl_var name=data_file_acodec_id2>;
f<tmpl_var name=data_file_id>.audio[1].CodecName = "<tmpl_var name=data_file_acodec_name2>";
f<tmpl_var name=data_file_id>.audio[1].ChanType = <tmpl_var name=data_file_chantype2>;
f<tmpl_var name=data_file_id>.audio[1].langID = <tmpl_var name=data_file_lang_id2>;
f<tmpl_var name=data_file_id>.audio[1].langName = "<tmpl_var name=data_file_lang_name2>";</tmpl_if>
// Subtitle Streams 
f<tmpl_var name=data_file_id>.subCnt = "<tmpl_var name=data_file_subcnt>";
f<tmpl_var name=data_file_id>.sub = new Array();
<tmpl_if expr="data_file_subcnt > 0">f<tmpl_var name=data_file_id>.sub[0] = new Object();
f<tmpl_var name=data_file_id>.sub[0].Type = <tmpl_var name=data_file_stype>;
f<tmpl_var name=data_file_id>.sub[0].Flags = <tmpl_var name=data_file_sflags>;
f<tmpl_var name=data_file_id>.sub[0].ID = <tmpl_var name=data_file_sub_id>;
f<tmpl_var name=data_file_id>.sub[0].Name = "<tmpl_var name=data_file_sub_name>";</tmpl_if>
<tmpl_if expr="data_file_subcnt > 1">f<tmpl_var name=data_file_id>.sub[1] = new Object();
f<tmpl_var name=data_file_id>.sub[1].Type = <tmpl_var name=data_file_stype2>;
f<tmpl_var name=data_file_id>.sub[1].Flags = <tmpl_var name=data_file_sflags2>;
f<tmpl_var name=data_file_id>.sub[1].ID = <tmpl_var name=data_file_sub_id2>;
f<tmpl_var name=data_file_id>.sub[1].Name = "<tmpl_var name=data_file_sub_name2>";</tmpl_if>
to get the streams, it's simplier and i don't ask for more vars than i need, of curse it would be nicer if exp put them in a <tmpl_loop>, but sticking with what we got it works just fine.

Edit: Redownload the image pack in the previous post, i've added the cantonese, mandarin, finish and tatar languages (audio/sub), i didn't add any icon for other though..
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

Ok, I will add some data, but some is not meant to be included in the templates IMO. We already have a lot of info. If you want all the info then visit the site and/or use anidb-o-matic.
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit »

DonGato wrote:Ok, I will add some data, but some is not meant to be included in the templates IMO. We already have a lot of info. If you want all the info then visit the site and/or use anidb-o-matic.
i agree with you, we got lots of info, i have more than you, but i like to have all the file info anyway :P

btw, DerIdiot just sent me an archive containing the contents of the icons folder, get it here.
it solves many of my spelling mistakes, which was the reason i couldn't get the tartar and finnish flags :P
(i've just removed the site images/buttons from the archive)
thanks to DerIdiot for the support :D
Locked