music.model¶
Module contents¶
ORM layer containing the data model
model.config¶
-
class
music.model.config.
Config
(*args, **kwargs)¶ Bases:
fireo.models.model.Model
Service-level config data structure for app keys and settings
-
collection
: fireo.managers.managers.Manager = <fireo.managers.managers.Manager object>¶
-
collection_name
= 'config'¶
-
last_fm_client_id
= None¶
-
playlist_cloud_operating_mode
= None¶ Determines whether playlist and tag update operations are done by Cloud Tasks or Functions
-
secret_key
= None¶
-
spotify_client_id
= None¶
-
spotify_client_secret
= None¶
-
model.playlist¶
-
class
music.model.playlist.
Playlist
(*args, **kwargs)¶ Bases:
fireo.models.model.Model
Smart playlist
- Parameters
Model ([type]) – [description]
- Returns
[description]
- Return type
[type]
-
add_last_month
= None¶
-
add_this_month
= None¶
-
chart_limit
= None¶
-
chart_range
= None¶
-
collection
: fireo.managers.managers.Manager = <fireo.managers.managers.Manager object>¶
-
collection_name
= 'playlists'¶
-
day_boundary
= None¶
-
description_overwrite
= None¶
-
description_suffix
= None¶
-
include_library_tracks
= None¶
-
include_recommendations
= None¶
-
include_spotify_owned
= None¶
-
last_updated
= None¶
-
lastfm_stat_album_count
= None¶
-
lastfm_stat_album_percent
= None¶
-
lastfm_stat_artist_count
= None¶
-
lastfm_stat_artist_percent
= None¶
-
lastfm_stat_count
= None¶
-
lastfm_stat_last_refresh
= None¶
-
lastfm_stat_percent
= None¶
-
mutable_keys
= ['type', 'include_recommendations', 'recommendation_sample', 'include_library_tracks', 'parts', 'playlist_references', 'shuffle', 'sort', 'description_overwrite', 'description_suffix', 'add_last_month', 'add_this_month', 'day_boundary', 'include_spotify_owned', 'chart_range', 'chart_limit']¶
-
name
= None¶
-
parts
= None¶
-
playlist_references
= None¶
-
recommendation_sample
= None¶
-
shuffle
= None¶
-
sort
= None¶
-
to_dict
()¶ Convert model into dict
-
type
= None¶
-
uri
= None¶
model.tag¶
-
class
music.model.tag.
Tag
(*args, **kwargs)¶ Bases:
fireo.models.model.Model
-
albums
= None¶
-
artists
= None¶
-
collection
: fireo.managers.managers.Manager = <fireo.managers.managers.Manager object>¶
-
collection_name
= 'tags'¶
-
count
= None¶
-
last_updated
= None¶
-
name
= None¶
-
proportion
= None¶
-
tag_id
= None¶
-
time_objects
= None¶
-
to_dict
()¶ Convert model into dict
-
total_time
= None¶
-
total_time_ms
= None¶
-
total_user_scrobbles
= None¶
-
tracks
= None¶
-
username
= None¶
-
model.user¶
-
class
music.model.user.
User
(*args, **kwargs)¶ Bases:
fireo.models.model.Model
-
access_token
= None¶
-
check_password
(password)¶
-
collection
: fireo.managers.managers.Manager = <fireo.managers.managers.Manager object>¶
-
collection_name
= 'spotify_users'¶
-
email
= None¶
-
get_playlist
(playlist_name: str, single_return=True, raise_error=True)¶ Get a user’s playlist by name with smart case sensitivity
Will return an exact match if possible, otherwise will return the first case-insensitive match
- Parameters
playlist_name (str) – Subject playlist name
single_return (bool, optional) – Return the best match, otherwise return (<exact>, <all matches>). <exact> will be None if not found. Defaults to True.
raise_error (bool, optional) – Raise a NameError if nothing found. Defaults to True.
- Raises
NameError – If no matching playlists found
- Returns
Found user’s playlists
- Return type
Optional[Playlist] or (<exact>, <all matches>)
-
get_playlists
()¶ Get all playlists for a user
- Returns
List of users playlists
- Return type
List[Playlist]
-
last_login
= None¶
-
last_refreshed
= None¶
-
lastfm_username
= None¶
-
locked
= None¶
-
password
= None¶
-
refresh_token
= None¶
-
spotify_linked
= None¶
-
to_dict
()¶ Convert model into dict
-
token_expiry
= None¶
-
type
= None¶
-
username
= None¶
-
validated
= None¶
-