Media Models
SQLAlchemy ORM definitions for:
Additionally, Media may be considered at podcast episode if it belongs to a mediadrop.model.podcasts.Podcast.
Media metadata and a collection of related files.
A list of mediadrop.model.categories.Category.
A query pre-filtered for associated comments. Returns mediadrop.model.comments.CommentQuery.
The date and time this player was first created.
A public-facing XHTML description. Should be a paragraph or more.
A public-facing plaintext description. Should be a paragraph or more.
The number of users who clicked ‘i DONT like this’.
Play time in seconds.
A flag to indicate whether this file is encoded in a web-ready state.
The primary key ID.
Increment the number of views in the database.
We avoid concurrency issues by incrementing JUST the views and not allowing modified_on to be updated automatically.
The number of users who clicked ‘i like this’.
The date and time this player was last modified.
Notes for administrative use – never displayed publicly.
The primary key of a podcast to publish this media under.
An integer score of how ‘hot’ disliking this media is.
Newer items with some likes are favoured over older items with more likes. In other words, ordering on this column will always bring the newest most liked items to the top. More info.
An integer score of how ‘hot’ liking this media is.
Newer items with some likes are favoured over older items with more likes. In other words, ordering on this column will always bring the newest most liked items to the top. More info.
An integer score of how ‘hot’ (likes - dislikes) this media is.
Newer items with some likes are favoured over older items with more likes. In other words, ordering on this column will always bring the newest most liked items to the top. More info.
A datetime range during which this object should be published. The range may be open ended by leaving publish_until empty.
A datetime range during which this object should be published. The range may be open ended by leaving publish_until empty.
A flag to indicate if this media should be published in between its publish_on and publish_until dates. If this is false, this is considered to be in draft state and will not appear on the site.
A flag to indicate whether this file has passed review by an admin.
Set the related categories of this media.
Parameters: | cats – A list of category IDs to set. |
---|
Set the tags relations of this media, creating them as needed.
Parameters: | tags – A list or comma separated string of tags to use. |
---|
A unique URL-friendly permalink string for looking up this object.
Be sure to call mediadrop.model.get_available_slug() to ensure the slug is unique.
An optional subtitle intended mostly for podcast episodes. If none is provided, the title is concatenated and used in its place.
A list of mediadrop.model.tags.Tag.
Display title.
Indicates whether the media is to be considered audio or video.
If this object has no files, the type is None. See Media.update_type() for details on how this is determined.
Ensure the type (audio/video) and encoded flag are properly set.
Call this after modifying any files belonging to this item.
The number of times the public media page has been viewed.
Audio or Video File
Return a list all possible playback URIs for this file.
Return type: | list |
---|---|
Returns: | mediadrop.lib.storage.StorageURI instances. |
The best-guess mimetype based on this file’s container format.
Defaults to ‘application/octet-stream’.
Er, none here. TODO: finish this page.