How to use the pymtp.models.LIBMTP_Album function in PyMTP

To help you get started, we’ve selected a few PyMTP examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emdete / python-mtp / pymtp / models.py View on Github external
"""

	def __repr__(self):
		return str(self.name)

LIBMTP_Album._fields_ = [
	("album_id", ctypes.c_uint32),
	("parent_id", ctypes.c_uint32),
	("storage_id", ctypes.c_uint32),
	("name", ctypes.c_char_p),
	("artist", ctypes.c_char_p),
	("composer", ctypes.c_char_p),
	("genre", ctypes.c_char_p),
	("tracks", ctypes.POINTER(ctypes.c_uint32)),
	("no_tracks", ctypes.c_uint32),
	("next", ctypes.POINTER(LIBMTP_Album)),
	]

class MTPAlbum(BaseModel):
	"""
		MTPAlbum

		An object representing a single album.
	"""

	def _get_album_id(self):
		"""
			A unique identifier for the album - typically, you don't manipulate
			this value manually.
		"""
		return int(self.base_structure.album_id)
github emdete / python-mtp / pymtp / models.py View on Github external
# ---------
# Defining LIBMTP_Album, MTPAlbum and MTPAlbums
# ---------

class LIBMTP_Album(ctypes.Structure):
	"""
		LIBMTP_Album

		Contains the ctypes structure for LIBMTP_album_struct
	"""

	def __repr__(self):
		return str(self.name)

LIBMTP_Album._fields_ = [
	("album_id", ctypes.c_uint32),
	("parent_id", ctypes.c_uint32),
	("storage_id", ctypes.c_uint32),
	("name", ctypes.c_char_p),
	("artist", ctypes.c_char_p),
	("composer", ctypes.c_char_p),
	("genre", ctypes.c_char_p),
	("tracks", ctypes.POINTER(ctypes.c_uint32)),
	("no_tracks", ctypes.c_uint32),
	("next", ctypes.POINTER(LIBMTP_Album)),
	]

class MTPAlbum(BaseModel):
	"""
		MTPAlbum