-
Notifications
You must be signed in to change notification settings - Fork 4
Mythling Media Services
Mythling comes with a set of PHP-implemented services that are optimized for retrieving structured media lists. These add capabilities currently lacking in the MythTV Services API, like Music listings and a Search function. Retrieving media lists is faster in Mythling when it uses these specialized services, because the results come pre-organized in the way the app uses them, and all sorting/filtering takes place on the server (actually in the database). Mythling services overlap only a fraction of MythTV services, and are not a substitute by any means. For example, Mythling services do not perform the heavy lifting involved in actually transcoding and streaming content.
####Contents
Setup
Video Categorization
Supported Parameters
Storage Groups
Limitations
-
Install Mythling Services
- Download media.php from GitHub:
https://github.com/oakesville/mythling/blob/master/media.php - If necessary, edit the first four lines to reflect your MythTV database information.
- Copy media.php somewhere under your Apache document root. The suggested location is mythling/media.php.
- Test service access from a browser:
http://<backend_ip>/mythling/media.php?type=recordings
- Download media.php from GitHub:
-
Open External Access
- For access from the Internet, configure Apache HTTP Proxying as described in External Network Access.
-
Configure On Device
- In the Mythling Connections preferences, enable the Backend Web Server and slide the Media Services switch to Mythling. In the Credentials section set the Backend Web user and password.
- Navigate back to the main screen and it'll now use Mythling services for populating its lists.
If Directories are used to categorize videos, then any files under the server directories designated in Mythling's Categories prefs are considered Movies and TV Series respectively (also see Supported Parameters), and everything else is considered Videos. If Metadata is selected, information in the videometadata table is used to decide what's a Movie vs TV Series vs plain Video. (See the MythTV Wiki MythVideo Metadata Lookup topic for a discussion on how to populate this table.) For Metadata categorization, the logic is as follows:
- If the inetref column is not populated then the item is considered a Video.
- If inetref is populated but neither season nor episode is populated, the item is considered a Movie.
- If inetref is populated and either season or episode is present, the item is considered a TV Series.
If None is selected as the categorization method, then all items are considered Videos. This same logic applies whether you're using Mythling or MythTV media list services.
For Movies and TV Series in Detail Mode, Mythling can display a link to an external site for information about the item. The Base URLs for these links can be specified in the Categories preference screen. The inetref value for the item is appended to the base URL to build the link destination. A Custom Base URL can also be designated, to which the URL-encoded item title is appended as an alternate link.
###Supported Parameters In case you'd like to access the Mythling services directly, or you just want a better understanding of how they work, here's a complete list of supported parameters with their possible values. These can be appended to the URL query string for an HTTP GET request. The return format is always JSON. - type (mandatory): - recordings - liveTv - videos - movies - tvSeries - search - sort (optional): - title (default) - date - rating - categorizeUsingMetadata (optional): - true (default) - categorizeUsingDirectories (optional): - true - movieDirs (optional, used with categorizeUsingDirectories) - (comma-delimited list of directories containing movies, relative to video base) - tvSeriesDirs (optional, used with categorizeUsingDirectories) - (comma-delimited list of directories containing TV shows, relative to video base) - videoExcludeDirs (optional, used with categorizeUsingDirectories) - (comma-delimited list of directories to exclude, relative to video base) - artworkStorageGroup (optional, for media with associated artwork) - storage group name with the artwork to display for each item - query (mandatory when type=search) - string to search for (case is ignored)Here's an example URL to list movies sorted by date, categorized using directories,
and displaying artwork from the Coverart storage group:
http://192.168.0.69/mythling/media.php?type=movies&sort=title&movieDirs=Horror%2CPre-Code&tvSeriesDirs=TV+Shows&videoExcludeDirs=Home+Movies&artworkStorageGroup=Coverart
https://github.com/oakesville/mythling/issues/8
Mythling Wiki How-To Guide