XAnt handling of images, way to optimize startup/storage?

Xlobby plugin development

XAnt handling of images, way to optimize startup/storage?

Postby WannaTheater on Tue Sep 11, 2007 1:08 pm

Hi, Thanks for the great plugin. I have some questions that I have been unable to figure out, perhaps the board can help.

I have a single ANT database with images included in the .amc file. When Xlobby starts, XAnt makes use of a filter (the ANT 'borrower' field) to split the .amc database into two Xlobby databases.

Code: Select all
[Movies_Family]
input=c:\Program Files\Ant Movie Catalog\Catalogs\Movies.amc
output=c:\Program Files\Xlobby\databases\movies_family.xml
images=c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\FamilyCovers\
sort=$$ITEM_ORIGINALTITLE
template=c:\Program Files\Xlobby\plugins\xant\moviestemplate.xml
filters=$$ITEM_BORROWER(Family)

[Movies_Mature]
input=c:\Program Files\Ant Movie Catalog\Catalogs\Movies.amc
output=c:\Program Files\Xlobby\databases\movies_mature.xml
images=c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\MatureCovers\
sort=$$ITEM_ORIGINALTITLE
template=c:\Program Files\Xlobby\plugins\xant\moviestemplate.xml
filters=$$ITEM_BORROWER(Mature)


Here is what I notice:
1) XAnt appears to write duplicate images to the specified Xant.ini "images" directories (it appears to ignore the filter with regard to extracting images), i.e. the contents of
c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\MatureCovers\
c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\FamilyCovers\
contain identical files, just different filenames.

2) ANT allows for "linking" to image files, i.e. the actual images are not stored in the .amc file, but rather in individual files. I would like to convert my .ant catalog to use linked images. When I tried to do this, XAnt does not make use if the "links," but copies the linked images to the specified "images" directory.

So combining (1) and (2), I actually end up with three directories all containing the same images:
(a) "c:\movie_covers", which contains my original .jpg images linked to by ANT movie entries
(b) "c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\MatureCovers\"
(c) "c:\Program Files\Ant Movie Catalog\Catalogs\XLobbyCovers\FamilyCovers\"

Is there a way for XAnt to do the following (perhaps specified in XAnt.ini)?
(1) BETTER: When filtering, only write the appropriate images to the image directories, instead of duplicates?
(2) BEST: If .amc catalog uses "linked" images, can XAnt just pass the link into the Xlobby XML database, instead of copying the image files, then using the location of the copies in the XLobby <coverart> item? This way, there would be no writing of a directory of images at all (filtered or non-filtered)! XLobby would just have <coverart> as "c:\movie_covers\mymovie1.jpg," etc...

Sorry for the long post.

Thanks again for the great plugin!
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: XAnt handling of images, way to optimize startup/storage?

Postby badubo on Tue Sep 11, 2007 2:21 pm

Filtering is done after processing the complete Ant file, so all images are extracted even if they are filtered out later.
If your images files are not inside the AMC (or if it is a .xml), if I remember correctly, you simply have to remove the key "images=..." in the section, and Xant will link to the original file, without copying it
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Re: XAnt handling of images, way to optimize startup/storage?

Postby WannaTheater on Tue Sep 11, 2007 3:30 pm

Thanks for the guidance. I tried to remove the complete key, i.e. the whole "images=" line from the .ini file. This did not work. But if I left the images= line target blank, it did work... no copying of images!

[Movies_Family]
input=c:\Program Files\Ant Movie Catalog\Catalogs\TESTIT\Movies.xml
output=c:\Program Files\Xlobby\databases\movies_family.xml
images=
sort=$$ITEM_ORIGINALTITLE
template=c:\Program Files\Xlobby\plugins\xant\moviestemplate.xml
filters=$$ITEM_BORROWER(Family)

[Movies_Mature]
input=c:\Program Files\Ant Movie Catalog\Catalogs\TESTIT\Movies.xml
output=c:\Program Files\Xlobby\databases\movies_mature.xml
images=
sort=$$ITEM_ORIGINALTITLE
....

Thanks for the help!
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: XAnt handling of images, way to optimize startup/storage?

Postby cooldog on Tue Sep 11, 2007 3:41 pm

I tried this, and it did not seem to work for me.

EDIT===============================================

Shoot! I did not see this:
I tried to remove the complete key, i.e. the whole "images=" line from the .ini file. This did not work. But if I left the images= line target blank, it did work... no copying of images!

in time!

==============================================

As an aside - it appears that XAnt uses dependancies to figure out whether it needs to regenerate the XLobby xml database. The Xant.ini file and the XAnt template files should be in this dependency list too.

Thanks for the great plugin --- without it, I would have given up on XLobby.
Last edited by cooldog on Tue Sep 11, 2007 3:52 pm, edited 1 time in total.
cooldog
 
Posts: 83
Joined: Mon Apr 10, 2006 12:48 am
Location: Kenton, Delaware, USA

Re: XAnt handling of images, way to optimize startup/storage?

Postby WannaTheater on Tue Sep 11, 2007 3:51 pm

Hmmm. Not sure why it didn't work. Here is what I did:

1) Used ANT to save my Movies.amc database as an Movies.XML database (Save_As). During the process it extracted all my coverart images into the database directory.
2) Closes ANT, then deleted original Movies.amc file
3) Started ANT and opened the Movies.XML file
4) Saved Movies.xml as a Movies.amc file... now I have no images in the .amc file
5) Deleted my xlobby .xml movie databases (to ensure regeneration from scratch)
6) Modified the "images=" line in the Xant.ini file to have no values
7) Started Xlobby, and all seems to be fine, with coverart pointing to the original images
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: XAnt handling of images, way to optimize startup/storage?

Postby cooldog on Tue Sep 11, 2007 4:01 pm

This didn't work because I *deleted* the images=xxxxx line from the .ini file, rather than making it "empty".

Also, although I would dearly love to regularize my image file names to all "movies_nnn.jpg" (some of the older ones have title-based names) your procedure doesn't export the jpg files for me, presumably because I do not have the jpgs stored in the amc database.

Ah well ... if it ever bothers me sufficiently, I'll write a AMC script to copy and relink the jpgs if the name is not in the correct format.


WannaTheater wrote:Hmmm. Not sure why it didn't work. Here is what I did:

1) Used ANT to save my Movies.amc database as an Movies.XML database (Save_As). During the process it extracted all my coverart images into the database directory.
2) Closes ANT, then deleted original Movies.amc file
3) Started ANT and opened the Movies.XML file
4) Saved Movies.xml as a Movies.amc file... now I have no images in the .amc file
5) Deleted my xlobby .xml movie databases (to ensure regeneration from scratch)
6) Modified the "images=" line in the Xant.ini file to have no values
7) Started Xlobby, and all seems to be fine, with coverart pointing to the original images
cooldog
 
Posts: 83
Joined: Mon Apr 10, 2006 12:48 am
Location: Kenton, Delaware, USA

Re: XAnt handling of images, way to optimize startup/storage?

Postby WannaTheater on Tue Sep 11, 2007 4:49 pm

I made the same mistake by fully omitting the line as well. I guess it needs to be there, just not set to a directory.

All of my images (low-res) are (or should I say 'were') stored in the .amc database. Since I have corresponding high resolution images, I didn't want to manually delete and add each to the ANT records. So I have removed the images from the .AMC file, and just copied/pasted my high res images to the same directory (overwriting low-res versions)...

Now I have high res versions in Xlobby
:)
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida