upsies.utils.disc.playlist

Normalized representation of a sequence of bluray or dvd video files

Functions

upsies.utils.disc.playlist.mark_main_playlists(playlists)[source]

Find the main playlist(s) and set their is_main property to True

Classes

class upsies.utils.disc.playlist.Playlist(items, filepath, *, discpath=None, duration=None, is_main=False)[source]

Bases: object

Representation of multiple videos in a sequence

property type

Underlying disc format

“bluray” if filename has the file extension “mpls”. “dvd” if filename has the file extension “ifo”. Empty string otherwise.

Matching is done case-insensitively.

property label

Human-readable string that serves as a unique playlist ID

Combination of discpath (if provided) and filename.

property items

Sequence of file paths in the playlist

property largest_item

Largest file in items

property filepath

Path of the playlist file (e.g. MPLS or IFO file)

property filename

Basename of filepath

property discpath

Path of the directory that contains filepath

Usually, this ia directory path that contains a “BDMV” or “VIDEO_TS” directory.

property discname

Basename of discpath

property size

Combined file size of all items as utils.types.Bytes

property duration

Combined runtime of items in seconds

property is_main

Simple boolean mark to track main playlists

This property is mutable.

property id

Sequence of values that make this instance unique

Instances with the same id are equal.