Modify

Opened 9 years ago

Closed 8 years ago

#6158 closed enhancement (wontfix)

Add Export to MythVideo Functionality to Watch Recordings

Reported by: robert.mcnamara@… Owned by: awithers
Priority: minor Milestone: unknown
Component: Plugin - MythVideo Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This patch adds a context menu item to Watch Recordings if MythVideo? is installed, "Export to MythVideo?." Based upon two settings in Utilities/Setup?->Setup->Media Settings->Video Settings->General Settings, directories will be created in the MythVideo? store and files created.

The two settings are "TV Export Directory Format" and "TV Export File Format." They take all the User Job style variables such as %TITLE%, %SUBTITLE%, %STARTTIMEISO%, Etc. The default values are:

Television/%TITLE% (Directory Format)

and

%TITLE% - %SUBTITLE% (File Format)

So, with A show like "Lost," Episode "The Lie," a default export to MythVideo? would:

1) Create directory $MythVideoDir/Television/Lost? if it does not exist. 2) Copy the file to $MythVideoDir/Television/Lost/Lost? - The Lie.mpg 3) Update table videometadata with the plot, title, year, user rating, etc. from the listings grabber/EIT.

Two notable caveats right now. The copy blocks the UI until it is done. It could really do with a busy indicator. Also, it presumes that all storage is local-- works great for a combined frontend/backend, not as well if the storage group is not locally or network mounted.

When Storage group move/copy code is committed, I will fix this to use it. I will make any bugfixes shortly, as well as copying the preview file to the MythVideo? poster store and setting it as the coverart.

Attachments (10)

PBBMVExport.diff (14.0 KB) - added by robert.mcnamara@… 9 years ago.
Adds Export to MythVideo? to PBB
PBBMVExport.2.diff (16.0 KB) - added by robert.mcnamara@… 9 years ago.
Moves recordedmarkup to filemarkup, copies thumbnail and sets as poster image
PBBMVExport.3.diff (16.1 KB) - added by robert.mcnamara@… 9 years ago.
This version of the patch works w/ #6159 to move screenshots to new "screenshot" field
PBBMVExport.4.diff (19.3 KB) - added by robert.mcnamara@… 9 years ago.
Adds custom export capability
PBBMVExport.5.diff (20.4 KB) - added by robert.mcnamara@… 9 years ago.
Lots of improvements/fixes
PBBMVExport.6.diff (22.7 KB) - added by robert.mcnamara@… 9 years ago.
Adds smart hunting for banner/fanart/coverfile
PBBMVExport.7.diff (22.7 KB) - added by robert.mcnamara@… 9 years ago.
D'oh! Mangled hunk on last version.
PBB-MV-export-3.11.09.diff (24.6 KB) - added by robert.mcnamara@… 9 years ago.
Multiple Improvements
PBB-MV-export-3.19.09.diff (26.6 KB) - added by robert.mcnamara@… 9 years ago.
Improvements small and large
MVExport.4.12.09.diff (27.9 KB) - added by robert.mcnamara@… 8 years ago.
Some random fixes

Download all attachments as: .zip

Change History (19)

Changed 9 years ago by robert.mcnamara@…

Adds Export to MythVideo? to PBB

Changed 9 years ago by robert.mcnamara@…

Moves recordedmarkup to filemarkup, copies thumbnail and sets as poster image

Changed 9 years ago by robert.mcnamara@…

This version of the patch works w/ #6159 to move screenshots to new "screenshot" field

Changed 9 years ago by robert.mcnamara@…

Adds custom export capability

comment:1 follow-up: Changed 9 years ago by robert.mcnamara@…

New version of the patch adds custom naming at export time, as seen here:

http://www.fecitfacta.com/export1.png http://www.fecitfacta.com/export2.png http://www.fecitfacta.com/export3.png

For a Quick export of television, most people will want to simple choose "Yes," but if you are trying to export something like a movie or a one-off that you don't want in your default export directory, you can do it from the popup. For the sake of documenting them, here are the allowed variables for directory and file naming:

%FILE% %TITLE% %SUBTITLE% %DESCRIPTION% %HOSTNAME% %CATEGORY% %RECGROUP% %PLAYGROUP% %CHANID% %STARTTIME% %ENDTIME% %STARTTIMEISO% %ENDTIMEISO% %PROGSTART% %PROGEND% %PROGSTARTISO% %PROGENDISO%

I'd love to find a clever way to include season and episode number, but that info's just not there in the listings. Maybe when/if directory preferences are added to MythVideo?, one of them can be lastseason/lastepisode which can be pulled and incremented as a variable.

This patch is a version compatible with the patches from #6159. To make it compatible with unpatched trunk, replace instances of the word "screenshot" in the patch with "coverfile".

comment:2 in reply to: ↑ 1 Changed 9 years ago by Nick Morrott <knowledgejunkie (at) gmail (dot) com>

Replying to robert.mcnamara@gmail.com:

I'd love to find a clever way to include season and episode number, but that info's just not there in the listings. Maybe when/if directory preferences are added to MythVideo?, one of them can be lastseason/lastepisode which can be pulled and incremented as a variable.

Episode number information, if present for a program, is available in recordedprogram.partnumber and recordedprogram.parttotal. There is no field for season number, although XMLTV can provide this information if available in the source listings.

comment:3 Changed 9 years ago by robert.mcnamara@…

partnumber and parttotal only apply (using Schedules Direct listings, anyway) to miniseries and "to be continued" episodes (ie part 1 of 2, part 2 of 2), and are no season episode numbers. Syndicatedepisodenumber is *closer* to this sometimes, but still so variable as to be useless (ie it's usually nothing, sometime something like "706" and sometimes something like "03"). There's no point in exposing something that will vary so wildly that it's useless, especially as it's not readily accessible using pginfo. I will look into the solution I suggested when it becomes practical, as it would provide a steady, consistent source for this information.

Next version of the patch will include %ORIGAIRYEAR%, %ORIGAIRDATE%, %CALLSIGN% and %CHANNAME%, however. I have this all working here but won't update the patch again until the storage group move/copy code is done.

Changed 9 years ago by robert.mcnamara@…

Lots of improvements/fixes

comment:4 Changed 9 years ago by robert.mcnamara@…

New version of the patch adds the following changes:

  • Lots of removed code duplication
  • Adds %ORIGAIRYEAR% %ORIGAIRDATE% %CALLSIGN% and %CHANNAME% variables
  • REQUIRES #6159 APPLIED TO COMPILE
  • Searches coverart, fanart, and banner directories for files that are named the same as DB column SERIESID (eg EP0017028.jpg/png/gif), and automatically sets any/all if available
  • Moves menu option into Storage Options Submenu

Changed 9 years ago by robert.mcnamara@…

Adds smart hunting for banner/fanart/coverfile

comment:5 Changed 9 years ago by robert.mcnamara@…

Thanks to some generous help and some fancy regex-fu, the export now hunts locally for the correct coverart/fanart/banner for the exported item. It works like this:

First priority is "Title of Show (Number, episode #, Season #, etc.)" Examples of things it will successfully find:

Battlestar Galactica 4.png BaTTLEstar_GalaTICA.Season_4_Episode_3.jpg Battlestar-galactica-season-4.jpg Battlestar Galactica 4x04.jpg Battlestar_Galactica_s04e04.png

So, more or less, it will take the title of the show, with periods, underscores, or dashes, plus any common notation of season or episode. It will select the latest of these numbers (ie Season 5 Episode 5 winsover Season 4 Episode 22). Most people will only want to drop in a new fanart once a season, but even if someone wants to change the one selected every episode, it's still only a matter of naming the new ones something remotely serialized.

If the hunt fails to find a file with name above, it will fall back to SERIESID.png (example: EP0087236.jpg). If that fails, it will select Title.png/jpg/gif as a last resort, again with any combination of underscore, dash, space, or period.

This should set grabbers for MV and the PBB (eventually) up to pull in an intelligently name the newest versions of the fanart/covers/banner (as you can pull in covers by season number, and always pull in the latest and name it appropriately). Want to change the fanart and banner going forward, but leave the rest the same? Drop in a new file and increment the number. New season of Chuck started? Drop in the new covers/fanart/banner, and your future exports will get them automatically.

Changed 9 years ago by robert.mcnamara@…

D'oh! Mangled hunk on last version.

Changed 9 years ago by robert.mcnamara@…

Multiple Improvements

comment:6 Changed 9 years ago by robert.mcnamara@…

Updated patch, a fair amount of new stuff.

First, as #6159 has been applied, you no longer need to apply that to use this patch. However, you will now need #6346 (Season #, Episode #, subtitle support for MythVideo?).

This new patch still does all the same old stuff, but adds the following:

-Will hunt for latest season and episode numbers in MythVideo? and by default, add one to the episode number in exporting. -Adds a new Export Menu context option, "Export (New Season)". This augments the season by one and sets episode number to 1 for this export. If the last episode was 1x24 and you do a New Season Export, you get 2x01. You get the idea.

  • Removes image hunt portions which have been committed to SVN as part of fanart/banner/coverart support in the PBB.

Changed 9 years ago by robert.mcnamara@…

Improvements small and large

comment:7 Changed 9 years ago by robert.mcnamara@…

A couple of improvements small and large. Various bugfixes and logic cleanup. I've also added the following options for File and directory naming:


%SEASON% - Numerical Season Number

%EPISODE% - Numerical Episode Number

%S##E##% - Season and episode in s01e01 format.

%##X##% - Season and episode in 1x01 format.


By way of example, using exporting Season 5, episode 9 of Lost with the following file format:

%TITLE% %##x##% - %SUBTITLE%

Gives you:

Lost 5x09 - Namaste.mpg

OR

Dir Format: %TITLE% Season %SEASON%/ File Format: %EPISODE% - %SUBTITLE%

would give you:

Lost Season 5/9 - Namaste.mpg

Etc. Please bear in mind that the episode numbers are "best guess" based on the latest season and episode numbers in MythVideo?. If you are exporting a show for the first time, use "Storage Options->Export to MythVideo?->Export with custom name/location" that time to set the season and episode properly. If a new season has started, use "Storage Options->Export to MythVideo?->Export (New Season)". Any "normal" mid-season, default export is just "Storage Options->Export to MythVideo?->Yes, Export to MythVideo?."

It's simple enough once you play with it. :)

(REQUIRES #6346 or for #6346 to be committed)

Changed 8 years ago by robert.mcnamara@…

Some random fixes

comment:8 Changed 8 years ago by robert.mcnamara@…

Had some small fixes locally that I figured I would get out here, since people are starting to play with this a bit. Only real change is that this version of the patch hunts for the latest inetref in a series so that it can set it properly on subsequent exports (instead of just setting it to "00000000" as previous).

comment:9 Changed 8 years ago by robertm

  • Resolution set to wontfix
  • Status changed from new to closed

I think I'm going to rewrite this one a little bit differently once we can handle metadata grabbing w/ the backend. In the meantime, one should use Raymond Wagner's python export script. These patches are out of date and I'm going to leave them that way until this can be done cleanly.

Add Comment

Modify Ticket

Action
as closed The owner will remain awithers.
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.