Author Topic: Export to XBMC  (Read 25841 times)

0 Members and 1 Guest are viewing this topic.

Offline CAD

  • Power User
  • ****
  • Posts: 167
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #20 on: September 15, 2009, 05:57:31 am »
Quote
It already does this without any changes, so in your example c:moviesmovienamemovie_5.1_en.nfo would be created. You can lso specify smth like nearfiles="..foldername%t%-%o(%y%)%.nfo" in the latest version of the plugin.

hi Nostra
i was not thinking about a fixed naming standard but using the actual file name and path of the movie from where it is saved on the hard drive. (using info scanned from hard drive)

what i am thinking is having an option for using data from file import.
Where it imports movie details (.avi, iso etc) from harddrive.
This writes a entry to (labeled) file path: eg c:\movie\mymovie.avi
This contains path where file was imported from and filename.
What i am thinking is then being able to use this info to export files into the directory where the files are physically stored.
(All this happens now)

something like nearfiles="%p%%f%.nfo"
where  %p% = path to where files are stored and %f% = file name

so if i have 3 movies stored in:
c:\movies\movie1\good_movie1.avi
c:\movies\movie2\chic_flic.iso
c:\movies\movie3\action01.avi

PVD does a scan folders on hard drive.
Populates "file path:" entries info with the 3 entries above.

i can then export into the directory where the files are stored.

so when i export.
good_movie1.nfo and poster.jpg gets saved to  c:\movies\movie1\ folder
chic_flic.nfo and poster.jpg gets saved to  c:\movies\movie2\ folder
action01.no and poster.jpg gets saved to  c:\movies\movie2\ folder

just need options in nearfiles to reference file path: (path and filename)

 :) Hope my ramblings make sense :)

three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #21 on: September 15, 2009, 08:45:25 am »
I should probably stay out of this, but...

Quote
just need options in nearfiles to reference file path: (path and filename)

As I understood it, the whole point of a nearfiles function was to create files "beside" the media file. In other words, typically, the exported files have exactly the same pathname, but a different extension. It seems the nearfiles function provided is more powerful than that, in that a path may be specified and variables may be used to construct a filename different than the media filename. But it seems to me nearfiles without any options should do what you need. So doesn't nearfiles=".nfo" work?

Offline CAD

  • Power User
  • ****
  • Posts: 167
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #22 on: September 15, 2009, 10:42:59 am »
there are different issues. I think my install at work may be corrupt. I will blow it away when i get back and test again -editing previous posts to remove issues until i can prove issue...

Quote
As I understood it, the whole point of a nearfiles function was to create files "beside" the media file. In other words, typically, the exported files have exactly the same pathname, but a different extension. It seems the nearfiles function provided is more powerful than that, in that a path may be specified and variables may be used to construct a filename different than the media filename. But it seems to me nearfiles without any options should do what you need. So doesn't nearfiles=".nfo" work?


It will create .nfo files. if I do nearfiles="%y%.nfo" I get individual files named after the title. title.nfo
if i do nearfiles="%ot%.nfo" i get alternative title.
They are saved either to last save place or (as i am finding out) to a path location c: omelocationtitle.nfo defined in nearfiles.
Nostra has not made an option to save the location to the file path/file name of the actual file. (using file import options.)
« Last Edit: September 15, 2009, 10:49:17 am by CAD »
three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #23 on: September 15, 2009, 12:43:11 pm »
I'm able to export a text files "beside" media files using nearfiles=".nfo"—so that doesn't seem to be the issue.

Posters can also be exported "beside" the video file.

I said that because we had talked about this capability much in the past. I thought the tools that were necessary to do so were now available. But I haven't actually had the need to do it. And now that I think about it, I haven't a clue how do it. Would someone please explain how this, and this alone, is done? What happens when there are multiple posters?

If these two things are possible, then is the issue how to get them both working in one template? If so, why not just use two templates?

Offline CAD

  • Power User
  • ****
  • Posts: 167
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #24 on: September 16, 2009, 02:28:39 am »
hiya rick
Quote
I'm able to export a text files "beside" media files using nearfiles=".nfo"—so that doesn't seem to be the issue.
yep - you can export .nfo and poster next to media but you have to tell PVD where to save the file. (or it will save to last location)

nearfiles works fantastic, but i want to make it automagic. :)

if i use tools/import movies/folders Ctl+F to import movies that are saved to the hard drive, PVD will populate File Location: field with path and file name of movie.

I want to be able to use this field when I do the export.

Nostra has made new fields available with nearfiles eg %t% %ot%. For what i want to do Nostra will need to modify nearfiles with extra options to read and export "file location" field.  (sorry Nostra) ;)

Currently - if i have a filtered view of Antz, Australia, Awake and i export using code below.
(note i have replace back slashes with forward slashes as back slashes seem to get filtered when i post)
Code: [Select]
imagenameformat="%t%%ext%" <==== Exports posters as titlename.jpg
nearfiles="d:/test%t%.nfo"   <==== Exports individual .nfo files. I found I needed to have a file path here: eg c:/xbmc

This will save Antz.nfo, Australia.nfo, Awake.nfo + their posters (nicely named) Antz.jpg, Australia.jpg, Awake.jpg to d:/temp
(great feature for backing up posters btw)  ;D

i have Antz stored on my HD in c:/movies/Antz (1998)/Antz_5.1_R1.iso
Australia is stored in c:/movies/Australia (2009)/Australia_5.1_R4.iso
if i used import from hard drive feature of PVD, the path and file name gets saved to "file location" field inside PVD.

i want to be able to use this path and file name when i do the export.
when i export for xbmc. PVD will save the files into c:/movies/Antz (1998)/ and will save the .nfo file as Antz_5.1_R1.nfo (poster should be saved there as well.

This will fully automate export and would also allow ppl to backup movie info/posters directly to where the media is located.

cool huh  8)
three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #25 on: September 16, 2009, 05:36:23 am »
Quote
yep - you can export .nfo and poster next to media but you have to tell PVD where to save the file. (or it will save to last location)

No, I don't think you're understanding me. I said, "the whole point of a nearfiles function was to create files "beside" the media file. In other words, typically, the exported files have exactly the same pathname, but a different extension."

The following template, for me, outputs an NFO file with the same pathname (but with an NFO extension) for each movie selected. This is exactly what I would expect a nearfiles function to do.

Code: [Select]
%OPTIONS%
nearfiles=".nfo"
%OPTIONS%
<title>{%value=title}</title>
<year>{%value=year}</year>

I also said I thought we would (in some release of 0.9.9.x) be able to export posters in exactly the same manner. The following template is the simplest I could come up with that would export posters "beside" the media files ("poster.txt" is only there because it seems something must be specified for the text output).

Code: [Select]
%OPTIONS%
nearfiles="poster.txt"
imagenameformat="%t% (%y%) poster%ext%"
%OPTIONS%
{%value=poster}

The posters do end up in the same directory as the media files. But while imagenameformat might make the filename similar to that of the media file, it's not likely to be the same. If it needs to be exactly the same, I don't see any way of doing that.

So the problem, if any, is not with nearfiles. Unless I'm failing to figure out how it's done, the problem is the lack of a function that will to the same thing with image files. From what I've seen, I suppose the same thing could be accomplished if variables for path, filename and full pathname could be used with imagenameformat.

Now, if I put the two templates together, I get this...

Code: [Select]
%OPTIONS%
nearfiles=".nfo"
imagenameformat="%t% (%y%) poster%ext%"
%OPTIONS%
<title>{%value=title}</title>
<year>{%value=year}</year>
<thumb>{%value=poster}</thumb>

...which puts an NFO file (incomplete, of course) "beside," and a poster "almost beside" the media file. While the poster filename is not exactly the same as the media filename, your NFO file points to it with the <thumb> variable (as I've illustrated). Is this not good enough for XBMC?

Offline CAD

  • Power User
  • ****
  • Posts: 167
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #26 on: September 16, 2009, 06:39:33 am »
tks Rick.
you are right.
Code: [Select]
nearfiles=".nfo"This works a treat when file path is populated. :D

i initially never tested with db entries that had this field populated. (and got wierd filepath errors)
after nostra made his changes i assumed a path had to be added for function to work. now i know better what nearfiles does.
THANKYOU. :)

do you know what the default behaviour is if filepath field is not populated or it can be changed??
as a fallback if filepath is is not populated or wrong, would it possible to have files exported to say export folder under preferences/folders and title or something similar as fuile name. pls.

i now have better understanding of how nearfiles is working. i can modify script.  8)
just need to get credits working now  :'( . Then i can strat on xbmc export for tv eps  :D

stay tuned ;D
three fingered salutation

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #27 on: September 16, 2009, 09:52:21 am »
Quote
do you know what the default behaviour is if filepath field is not populated or it can be changed??

I'm sure it does nothing at all. The only reason I can think of that you would not have File path filled is there is no media. This is a situation I'm very familiar with. Most of the movies in my database are ones I've seen over the years—I don't have media. My media manager (J. River Media Center), however, only records information about media files. I imagine XBMC is the same. The solution is simple. Just create a dummy file for each movie—named in the same manner as any movie file, but with a different extension, like LOG. (Export a list to Excel and use that to create a batch file to create the dummy files.) I configure both PVD and MC to recognize LOG as a valid file type, and both happily find import these files. I then use PvdImport (a MC plugin that pulls information directly from the PVD database) to import PVD data to MC.

If you're just concerned about excluding moves for which there is no media, filter them out before running the export. I doubt it matters, however. Those without files will just be skipped.

I think it's now nostra's turn to help you with the credits. ;)  I hope he'll also tell us if my understanding of how the exporting of posters works is correct.

Offline deazo

  • Power User
  • ****
  • Posts: 278
    • View Profile
Re: Export to XBMC
« Reply #28 on: September 16, 2009, 05:56:30 pm »

 Hi all,

 correct me if I'm saying something stupid but from what I have read of your post Rick, you're looking for a way to have the image file saved beside the movie file automatically.
 With my test config this actually worked perfectly using CAD's script.
 I ended up with posters files right next to my .avi file with the same name.
 Unless you meant other types of images? (i.e. not posters?)

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #29 on: September 16, 2009, 10:43:07 pm »
Quote
With my test config this actually worked perfectly using CAD's script.
 I ended up with posters files right next to my .avi file with the same name.

CAD's scripti includes imagenameformat="%t%%ext%", so the posters are named [Title].jpg. That's fine if the movie file is named [Title].avi, but that's not necessarily the case. I want it to be named [filename].jpg. And as a stand-alone function (i.e., not used with nearfiles), I would like it to be able to do [full filepath].jpg (I'm using ".jpg" just to be clear—it would actually be the result of %ext%).

I should point out, I have no particular interest in XBMC. I would like to see a function that works well generally. I think saving an image "beside" a subject file is a common requirement—just as doing so with a text file is. It's also just a good file management practise. What I was expecting was something like "posternearfiles" where posternearfiles="" would result in [full filepath].jpg, posternearfiles="%t" (%y%)%ext%" would result in a renamed file in the same folder, and posternearfiles="C:\My posters\%fn%%ext%" would put them all in one folder with the same filenames ("fn") as the movies.

I suppose this might be generalized to imagenearfiles where there would be a parameter for specifying the image type. I don't know if there's any interest in exporting screen shots and covers, however.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #30 on: September 17, 2009, 02:44:43 am »
In main template you add:
Code: [Select]
{%value=actors template="pages\actors.tpl"}
In actors.tpl:
Code: [Select]
<actor>
<name>{%param=name}</name>
<role>{%param=role}</role>
</actor>

The same for directors, writers, etc.
Gentlemen, you can’t fight in here! This is the War Room!

Offline CAD

  • Power User
  • ****
  • Posts: 167
  • I've got my eye on you!
    • View Profile
Re: Export to XBMC
« Reply #31 on: September 17, 2009, 07:02:48 am »
Hi Nostra.
i have actors working ok.
i cant get credits to work (or understand how grouptemplate works even)

in http://www.videodb.info/forum_en/index.php?topic=766.0 it looks like there is options for exporting credits.


Variables
Variables are formatted like this: {%value=[number] oprion1="value" optionN="value"}
There are also some special variables:
{%value}   (without number or options) is used in subtemplates for fields with multiple values, pages subtemplates for page numbers and in rating subtemplates (rating as stars) for rating value.
{%param=[value]}   is used in subtemplates for fields with different types of data associated (for example actors field can include such information as person id (pid), names, URL, role)
{%groupparam=[value]}   is used in subtemplates that support grouping (for example: awards, filmography) to identify by what parameter values should be gouped


Varables for information fields:
Movies:
...
...
CDCover   66   width, height, template, maxvalues, params
Credits   67   template, grouptemplate
Episodes   68   template, grouptemplate
three fingered salutation

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #32 on: September 17, 2009, 03:13:55 pm »
There is an option for credits, but I have never tested it. Now I did took a look at the implementation of this option and saw that it would not function in the current version of the plugin, so you will need to export each type of credits separately until the next version of the plugin...
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to XBMC
« Reply #33 on: September 17, 2009, 07:49:02 pm »
So the problem, if any, is not with nearfiles. Unless I'm failing to figure out how it's done, the problem is the lack of a function that will to the same thing with image files. From what I've seen, I suppose the same thing could be accomplished if variables for path, filename and full pathname could be used with imagenameformat.

I should point out, I have no particular interest in XBMC. I would like to see a function that works well generally. I think saving an image "beside" a subject file is a common requirement—just as doing so with a text file is. It's also just a good file management practise. What I was expecting was something like "posternearfiles" where posternearfiles="" would result in [full filepath].jpg, posternearfiles="%t" (%y%)%ext%" would result in a renamed file in the same folder, and posternearfiles="C:\My posters\%fn%%ext%" would put them all in one folder with the same filenames ("fn") as the movies.

Nostra, is my understanding of the current capability for exporting posters beside media files correct? Or is there some way to export posters so they have exactly the same file pathname as the media file, but with the image format extension?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #34 on: September 18, 2009, 10:01:01 am »
Yes, it seems like I will need to add posternearfiles in the next version...
Gentlemen, you can’t fight in here! This is the War Room!

Offline zkn

  • Member
  • *
  • Posts: 1
    • View Profile
Re: Export to XBMC
« Reply #35 on: January 22, 2011, 01:33:34 pm »
Yes, it seems like I will need to add posternearfiles in the next version...
so is there such new keyword like "posternearfiles" ?
or is it planned or rejected?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to XBMC
« Reply #36 on: January 23, 2011, 06:33:40 pm »
It is already implemented. If you have nearfiles variable set, then all image paths will be relative to this path.
Gentlemen, you can’t fight in here! This is the War Room!

Offline Morgenstern72

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Export to XBMC
« Reply #37 on: December 29, 2013, 11:44:09 am »
I appreciate all your work and attempts to explain to us how this is working. Still: I have no idea.

Is there any possibility you could zip a configured "template" and how to use it, just to be able to use PVD as "brain" and XBMC as frontend? I am completely confused at this point how I would do that...which is my fault, since I just can't get what I have to extract out of these postings to make it work.

Thx alot if anyone takes the time to walk me through this :)
PVD 1.0.2.7
Windows 7 Pro 64bit

Offline VVV_Easy_Programing

  • User
  • ***
  • Posts: 98
    • View Profile
Re: Export to XBMC
« Reply #38 on: January 17, 2014, 07:08:49 pm »
I attached a zip that can help: you just must to unzip in the folder Templates PVD (the file and the folder of the zip).
I tried to make it as complete as possible so the Template needs to have three Custom Fields 'Set' 'IMDB_Votes' 'Top_250' (with underscore because in other case it is blocking the Template). You must define in the Preferences of PVD.
In any case you can delete these lines and other information that you are not interested (eg exporting images).
If you want to renew your XBMC library, I suggest using "SQLiteSpy" or "SQLite Database Browser" to open the database XBMC "MyVideos75.db" and copy of the C09 column (code IMDB) and the column C22 (movies folder) of the table "movies" to Excel .
In Excel you get the URL of the movie like "http://www.imdb.com/title/" + tt****** + "/" and you import the table PVD.
To return to XBMC:
- With PVD scratch the information you want, you use the Template for NFO files.
- With RenameMaster you rename the images to the names of XBMC "folder.jpg" "Fanart.jpg".
- With XBMC empty library, make another tracing your movies with the scraper that you use. It will ask you if you use the Internet or NFO file.
I hope you serve  (Edito: New version down)
« Last Edit: January 18, 2014, 04:09:17 pm by VVV_Easy_Programing »

Offline VVV_Easy_Programing

  • User
  • ***
  • Posts: 98
    • View Profile
Re: Export to XBMC
« Reply #39 on: January 18, 2014, 04:07:34 pm »
Fixed bug in exporting images that blocked (missing a space between the parameters)
« Last Edit: January 19, 2014, 09:10:18 pm by VVV_Easy_Programing »