Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add album count display option for music libraries #180

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ You will need to set the following environment variables:
| TC_VC_TV_SERIES_COUNT | No | Display series counts for all selected "TV Shows" libraries | "True" |
| TC_VC_TV_EPISODE_COUNT | No | Display episode counts for all selected "TV Shows" libraries | "True" |
| TC_VC_MUSIC_ARTIST_COUNT | No | Display artist counts for all selected "Music" libraries | "True" |
| TC_VC_MUSIC_ALBUM_COUNT | No | Display album counts for all selected "Music" libraries | "True" |
| TC_VC_MUSIC_TRACK_COUNT | No | Display track counts for all selected "Music" libraries | "True" |
| TC_DISCORD_ADMIN_IDS | No | List of Discord IDs with admin privileges | ID, right-click user profile in Discord |
| TC_DISCORD_POST_SUMMARY_MESSAGE | No | Whether to post a stat summary text message | "True" |
Expand Down
1 change: 1 addition & 0 deletions config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Tautulli:
TVSeriesCount: true
TVEpisodeCount: true
MusicArtistCount: true
MusicAlbumCount: true
MusicTrackCount: true
Performance:
CategoryName: "Performance"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ services:
TC_VC_TV_SERIES_COUNT: "True"
TC_VC_TV_EPISODE_COUNT: "True"
TC_VC_MUSIC_ARTIST_COUNT: "True"
TC_VC_MUSIC_ALBUM_COUNT: "True"
TC_VC_MUSIC_TRACK_COUNT: "True"
TC_DISCORD_ADMIN_IDS: my_user_id,my_second_user_id
TC_DISCORD_POST_SUMMARY_MESSAGE: "True"
Expand Down
1 change: 1 addition & 0 deletions modules/emojis.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def __init__(self) -> None:
"series": "📺",
"artist": "🎤",
"artists": "🎤",
"albums": "📀",
"track": "🎵",
"tracks": "🎵",
"unknown": "❓",
Expand Down
7 changes: 7 additions & 0 deletions modules/settings/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ def show_music_artist_count(self) -> bool:
env_name_override="TC_VC_MUSIC_ARTIST_COUNT")
return _extract_bool(value)

@property
def show_music_album_count(self) -> bool:
value = self._libraries_voice_channels._get_value(key="MusicAlbumCount", default=True,
env_name_override="TC_VC_MUSIC_ALBUM_COUNT")
return _extract_bool(value)

@property
def show_music_track_count(self) -> bool:
value = self._libraries_voice_channels._get_value(key="MusicTrackCount", default=True,
Expand All @@ -304,6 +310,7 @@ def voice_channel_settings(self) -> Dict[str, Any]:
statics.KEY_SHOW_TV_EPISODES: self.show_tv_episode_count,
statics.KEY_SHOW_TV_SERIES: self.show_tv_series_count,
statics.KEY_SHOW_MUSIC_ARTISTS: self.show_music_artist_count,
statics.KEY_SHOW_MUSIC_ALBUMS: self.show_music_album_count,
statics.KEY_SHOW_MUSIC_TRACKS: self.show_music_track_count,
statics.KEY_STATS_CHANNEL_IDS: self.stats_voice_channels_ids,
statics.KEY_USE_STATS_CHANNEL_IDS: self._use_stats_voice_channel_ids,
Expand Down
2 changes: 2 additions & 0 deletions modules/settings/settings_transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
KEY_SHOW_TV_EPISODES,
KEY_SHOW_TV_SERIES,
KEY_SHOW_MUSIC_ARTISTS,
KEY_SHOW_MUSIC_ALBUMS,
KEY_SHOW_MUSIC_TRACKS,
)

Expand All @@ -11,4 +12,5 @@ def __init__(self, settings: dict):
self.show_tv_episodes = settings.get(KEY_SHOW_TV_EPISODES, False)
self.show_tv_series = settings.get(KEY_SHOW_TV_SERIES, False)
self.show_music_artists = settings.get(KEY_SHOW_MUSIC_ARTISTS, False)
self.show_music_albums = settings.get(KEY_SHOW_MUSIC_ALBUMS, False)
self.show_music_tracks = settings.get(KEY_SHOW_MUSIC_TRACKS, False)
1 change: 1 addition & 0 deletions modules/statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
KEY_SHOW_TV_EPISODES = "show_tv_episodes"
KEY_SHOW_TV_SERIES = "show_tv_series"
KEY_SHOW_MUSIC_ARTISTS = "show_music_artists"
KEY_SHOW_MUSIC_ALBUMS = "show_music_albums"
KEY_SHOW_MUSIC_TRACKS = "show_music_tracks"
KEY_STATS_CHANNEL_IDS = "stat_channel_ids"
KEY_USE_STATS_CHANNEL_IDS = "use_stat_channel_ids"
Expand Down
2 changes: 2 additions & 0 deletions modules/tautulli/tautulli_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def get_library_item_count(self, library_name: str, emoji_manager: EmojiManager,
case 'artist':
if visibility_settings.show_music_artists:
results.append((emoji_manager.get_emoji(key="artists"), library_info.get('count')))
if visibility_settings.show_music_albums:
results.append((emoji_manager.get_emoji(key="albums"), library_info.get('parent_count')))
if visibility_settings.show_music_tracks:
results.append((emoji_manager.get_emoji(key="tracks"), library_info.get('child_count')))
return results
Expand Down
1 change: 1 addition & 0 deletions templates/tauticord.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<Config Name="Display TV series counts" Target="TC_VC_TV_SERIES_COUNT" Default="True" Description="Display series counts for all configured TV Show libraries" Type="Variable" Display="always" Required="false" Mask="false">True</Config>
<Config Name="Display TV episode counts" Target="TC_VC_TV_EPISODE_COUNT" Default="True" Description="Display episode counts for all configured TV Show libraries" Type="Variable" Display="always" Required="false" Mask="false">True</Config>
<Config Name="Display music artist counts" Target="TC_VC_MUSIC_ARTIST_COUNT" Default="True" Description="Display artist counts for all configured Music libraries" Type="Variable" Display="always" Required="false" Mask="false">True</Config>
<Config Name="Display music track counts" Target="TC_VC_MUSIC_ALBUM_COUNT" Default="True" Description="Display album counts for all configured Music libraries" Type="Variable" Display="always" Required="false" Mask="false">True</Config>
<Config Name="Display music track counts" Target="TC_VC_MUSIC_TRACK_COUNT" Default="True" Description="Display track counts for all configured Music libraries" Type="Variable" Display="always" Required="false" Mask="false">True</Config>
<Config Name="Discord admin IDs" Target="TC_DISCORD_ADMIN_IDS" Default="" Description="Comma-separated list of IDs of Discord users with bot admin privileges" Type="Variable" Display="always" Required="false" Mask="false" />
<Config Name="Post stream details" Target="TC_DISCORD_POST_SUMMARY_MESSAGE" Default="True" Description="Whether to post a stream details summary text message" Type="Variable" Display="always" Required="true" Mask="false">True</Config>
Expand Down
Loading