Thanks.
But weird, though... For me, whenever a film name consists only of numbers it ends up prefixed with "details - ", I tried several naming styles yet none would work.
The film gets detected correctly, only the name is wrong.
e.g.:"details - 2012", "details - 21"...
My export: http://goo.gl/gI8K
Hi,
I love your work (very easy to use, very clean & a useful way to share its collection) !
I notice a bug in the last version : the seasons for a tv show are not in the right order (3 before 2 & before 4 for example).
Good luck !
If you download the latest version and re-run the export this should now be fixed.
Hello,
I just recognized that Plex Web Export don’t use local posters. Instead you see a blank cover.
Cheers Thomas
Hi Thomas,
The export gets whatever thumbnail the Plex server reports. Are you referring to the background posters or the small icon for each movie/show? If it's the latter I'll look into user-set ones, but as for the larger posters they're not exported as they would just be too big for the website to serve if you're browsing a lot of films.
Hello,
I’m meaning the small covers of each movie.
Please have a look into section “TV Shows” and you’ll see what I mean:
My library
These are TV Shows, where I selected the cover from a local .jpg.
Cheers Thomas
Ah cool, I don't have any custom artwork myself so never noticed it. Added to the bug list :)
Dachande663,
Thanks for this great job !
I spent some time understanding your code and I really like it. Very clean and robust !
I succeeded in adding a “Music” section very easily.
For now, it just displays a picture of the artist, its description and the genres.
In “cli.php” :
Replace
if($type=='movie' or $type=='show')
By
if($type=='movie' or $type=='show' or type=='artist')
And replace
<br />
switch($section['type']) {<br />
case 'movie':<br />
$object_to_loop = $xml->Video;<br />
$object_parser = 'load_data_for_movie';<br />
break;<br />
case 'show':<br />
$object_to_loop = $xml->Directory;<br />
$object_parser = 'load_data_for_show';<br />
break; <br />
default:<br />
plex_error('Unknown section type provided to parse: '.$section['type']);<br />
return false;<br />
}<br />
By
<br />
switch($section['type']) {<br />
case 'movie':<br />
$object_to_loop = $xml->Video;<br />
$object_parser = 'load_data_for_movie';<br />
break;<br />
case 'show':<br />
$object_to_loop = $xml->Directory;<br />
$object_parser = 'load_data_for_show';<br />
break;<br />
case 'artist':<br />
$object_to_loop = $xml->Directory;<br />
$object_parser = 'load_data_for_show';<br />
break; <br />
default:<br />
plex_error('Unknown section type provided to parse: '.$section['type']);<br />
return false;<br />
}<br />
It works ! but my "data.js" is 3MB right now :(. Clearly, the model doesn't scale very well. Especially if you want to add TV show episodes description in the future.
Maybe, by producing a separate .js (json) file per item and streaming it (on-demand) through ajax the page will load faster.
Cheers,
Cheers. If you're familiar with Git you can actually submit code as a pull request for easy merging. I am going to add music similar to this, but re-using the current parser for tv shows will knock on some things (basic icon for a start).
And yes, my big goal at the moment is to refactor the code to improve the speed.
Ok, I'll branch your code on git. However, the goal I'm trying to achieve is different from yours. I'm trying to add a download link when I'm authenticated.
Right now, I succeded in adding a download icon to all my movies (but not Tv shows yet). Clicking it brings me to another website where I installed [mollify](http://www.mollify.org/) and download starts.
Also, I noticed that load_data_for_show() and load_data_for_movie() have some redundancy. Maybe you should consider replacing them with PHP Classes and take profit from inheritance.
You would have a tree structure that looks somewhat like this :
<br />
Parser<br />
|<br />
L DirectoryParser<br />
| L TVShowParser<br />
| L SeasonParser<br />
| L SectionParser<br />
| L .....<br />
L LeafItemParser<br />
| L MovieParser<br />
| L EpisodeParser<br />
| L MusicTrackParser<br />
| L PhotoParser <br />
| L ....<br />
Being modular will allow to add stuff very easily since each parser will only define its "new" fields.
Generic fields like "key" and "type" would be declared in the upper classes.
In addition, json_encode can encode the resulting object. => No arrays needed.
Cheers,
The initial code was designed to be quick and dirty so hence the lack of forward planning. And objects are cast to arrays where necessary as JavaScript can be a pain iterating over objects.
I really don't think it is. c.f, my first post :) I just thought it would be easier for me to add stuff (like photos and music) if parsers were designed as a class tree and not as functions.
Maybe, I'm not very familiar with js.
Anyway, I'll commit the few lines I've added to github asap.
Cheers,
Awesome software!
I would also love to be able to see recent additions to the library. I don’t know if it is possible to get this from the Plex api though. It could either be the import date to the plex library, or even just the release date of each episode.
For me, the ultimate implementation would also group it by day added/released:
Recent Additions:
-Today
– Series 1, episode number/title
– Series 2, episode number/title
-Yesterday
– Series 3, episode number/title
-Saturday (11/11/11)
– Series 4, episode number/title
Seems like you are an expert in integrating functions nicely Dachande663, so if you decide to implement this I bet you figure out the best place to put it.
The system does indeed show the date items were added (I believe). If I did add it (that should be, when I add it), it will most likely be as another sort option similar to rating or release date with the date added shown on the popup.
I don’t mean to be “that” guy but is there anyway someone can put up an install guide for this in complete novice speak?
Haha sorry, it’s just what I’m looking for but I’m kinda new to macs and have never opened Terminal
Cheers guys (hangs head in shame)
[list=1]
[*]Open Terminal
[*]Drag the downloaded folder in the window.
[*]Type cd/ before the path of the folder - Hit enter *(Your-Mac-Pro:~ user$ **cd /**Users/user/Downloads/Dachande663-Plex-Export-a517074)*
[*]You are now inside the folder. Type, php cli.php - Hit enter *(Your-Mac-Pro:Dachande663-Plex-Export-a517074 user$ **php cli.php**)*
[*]Open the html file in your browser
[/list]
Absolute awesomeness!! Thanks so much for your excellent work!
I have made a little change that allows specifying an output directory, to which index.html and the assets directory are copied after the JSON file has been created. This allows to keep the GIT repository out of the HTTP server's document root.
I am by no means a PHP programmer, so take my code with a grain of salt. Also, you mention some bug in the PHP CLI, which may be triggered by this change.
Hi Sam,
There's already a flag to specify the output directory. Can't view your patch at the moment (mobile) but wondered how yours differs? Also, the outputted files are ignored by git and most web servers should refuse to serve a dot-prefixed file (I believe). Cheers.
Hi Luke,
Are you referring to the data-dir option? As far as I could tell it is relative to the current directory. Or is there another option I have missed?
With my option I can have different directories with the Plex-Export dump from different Plex servers using a single git repository.
Cheers,
Sam
Ah yes, it wasn't updated when I changed the path handler. It wouldn't copy the index.html etc as it sounds yours does. Thanks.