Mopidy-Podcast Data Models¶
Mopidy-Podcast extends Mopidy’s data model by providing additional domain-specific types. These immutable data models are used for all data transfer between Mopidy-Podcast extensions and the Mopidy-Podcast core module. The intricacies of converting from/to Mopidy’s native data models are left to the Mopidy-Podcast module, so extension developers can work solely with domain objects.
These models are based on Apple’s – rather informal – podcast specification, which in turn is based on RSS 2.0.
- class mopidy_podcast.models.Podcast(*args, **kwargs)¶
Mopidy model type to represent a podcast.
Parameters: - uri (string) – podcast URI
- title (string) – podcast title
- link (string) – Web site URI
- copyright (string) – copyright notice
- language (string) – ISO two-letter language code
- pubdate (datetime.datetime) – publication date and time
- author (string) – author name
- block (boolean) – prevent the podcast from appearing
- category (string) – main category
- image (Image) – podcast image
- explicit (boolean) – whether the podcast contains explicit material
- complete (boolean) – whether the podcast is complete
- newfeedurl (string) – new feed location
- subtitle (string) – short description
- summary (string) – long description
- episodes (list of Episode) – podcast episodes
The podcast’s author’s name.
- block = None¶
Prevent a podcast from appearing in the directory.
- category = None¶
The main category of the podcast.
- complete = None¶
Indicates completion of the podcast.
- copyright = None¶
The podcast’s copyright notice.
- explicit = None¶
Indicates whether the podcast contains explicit material.
- language = None¶
The podcast’s ISO two-letter language code.
- link = None¶
The URL of the HTML website corresponding to the podcast.
- newfeedurl = None¶
Used to inform of new feed URL location.
- pubdate = None¶
The podcast’s publication date and time as an instance of datetime.datetime.
- subtitle = None¶
A short description of the podcast.
- summary = None¶
A description of the podcast, up to 4000 characters long.
- title = None¶
The podcast’s title.
- uri = None¶
The podcast URI.
For podcasts distributed as RSS feeds, the podcast URI is the URL from which the RSS feed can be retrieved.
To distinguish between podcast and episode URIs, the podcast URI MUST NOT contain a fragment identifier.
- class mopidy_podcast.models.Episode(*args, **kwargs)¶
Mopidy model type to represent a podcast episode.
Parameters: - uri (string) – episode URI
- title (string) – episode title
- guid (string) – globally unique identifier
- pubdate (datetime.datetime) – publication date and time
- author (string) – author name
- block (boolean) – prevent the episode from appearing
- image (Image) – episode image
- duration (datetime.timedelta) – episode duration
- explicit (boolean) – whether the podcast contains explicit material
- order (integer) – override default ordering
- subtitle (string) – short description
- summary (Enclosure) – long description
- enclosure – media object
The episode’s author’s name.
- block = None¶
Prevent an episode from appearing in the directory.
- duration = None¶
The episode’s duration as an instance of datetime.timedelta.
- enclosure = None¶
The media object, e.g. the audio stream, attached to the episode as an instance of Enclosure.
- explicit = None¶
Indicates whether the episode contains explicit material.
- guid = None¶
A string that uniquely identifies the episode.
- order = None¶
Overrides the default ordering of episodes.
- pubdate = None¶
The episode’s publication date and time as an instance of datetime.datetime.
- subtitle = None¶
A short description of the episode.
- summary = None¶
A description of the episode, up to 4000 characters long.
- title = None¶
The episode’s title.
- uri = None¶
The episode URI.
If the episode contains an enclosure, the episode URI MUST consist of the associated podcast URI with the enclosure URL appended as a fragment identifier.
- class mopidy_podcast.models.Image(*args, **kwargs)¶
Mopidy model type to represent a podcast’s image.
Parameters: - uri (string) – image URI
- title – image title
- width (integer or None) – image width in pixels
- height (integer or None) – image height in pixels
- height = None¶
The image’s height in pixels.
- title = None¶
The image’s title.
- uri = None¶
The image’s URI.
- width = None¶
The image’s width in pixels.
- class mopidy_podcast.models.Enclosure(*args, **kwargs)¶
Mopidy model type to represent an episode’s media object.
Parameters: - uri (string) – enclosure URI
- length (integer) – enclosure file size in bytes
- type (string) – enclosure MIME type
- length = None¶
The enclosure’s file size in bytes.
- type = None¶
The MIME type of the enclosure, e.g. audio/mpeg.
- uri = None¶
The URI of the media object.
- class mopidy_podcast.models.Ref(*args, **kwargs)¶
Extends mopidy.models.Ref to provide factory methods and type constants for Podcast and Episode.
Parameters: - uri (string) – object URI
- name (string) – object name
- type (string) – object type
- EPISODE = u'episode'¶
Constant used for comparison with the type field.
- PODCAST = u'podcast'¶
Constant used for comparison with the type field.