Skip to content

Commit

Permalink
f-string bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwalVandana committed Aug 17, 2024
1 parent 5c2fd14 commit a37ecba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions maestro/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,10 @@ def list_(
for album_artist in song.album_artist.split(", "):
if album_artists:
for search_album_artist in album_artists:
if search_album_artist.lower() in album_artist.lower():
if (
search_album_artist.lower()
in album_artist.lower()
):
abcs[album_artist][0] += song.listen_times[year]
abcs[album_artist][1] += song.duration
break
Expand Down Expand Up @@ -2293,7 +2296,7 @@ def style_clip_name(clip_name, song):

if "default" in song.clips:
click.echo(
f"\t{style_clip_name("default", song)}: {song.clips['default'][0]}, {song.clips['default'][1]}"
f"\t{style_clip_name('default', song)}: {song.clips['default'][0]}, {song.clips['default'][1]}"
)
for clip_name, (start, end) in song.clips.items():
if clip_name == "default":
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![PyPI downloads](https://static.pepy.tech/badge/maestro-music)](https://pepy.tech/project/maestro-music) [![PyPI version](https://badge.fury.io/py/maestro-music.svg)](https://badge.fury.io/py/maestro-music) [![Support server](https://img.shields.io/discord/1117677384846544896.svg?color=7289da&label=maestro-cli&logo=discord)](https://discord.gg/AW8fh2QEav)

`maestro` is a command-line tool to play songs (or any audio, really) in the terminal.
![](data/player.png)
![](https://github.com/PrajwalVandana/maestro-cli/raw/master/data/player.png)

Check out the [Discord server](https://discord.gg/AW8fh2QEav)!
## Features
Expand All @@ -19,7 +19,7 @@ Check out the [Discord server](https://discord.gg/AW8fh2QEav)!
- [audio visualization](#visualization) directly in the terminal!
- [Discord integration](#discord-status)!
- Now Playing Center integration on macOS! (allows headphone controls)
![](data/now_playing.png)
![](https://github.com/PrajwalVandana/maestro-cli/raw/master/data/now_playing.png)
- [music discovery](#music-discovery)!
## Installation
### Using `pip`
Expand All @@ -37,7 +37,7 @@ Using Python and `pip` is the preferred way; executables may be slower, have bug
#### macOS
Download the `.pkg` file corresponding to your Mac's architecture; Apple Silicon (M1, M2, M3, etc.) or Intel. Right click on the file in Finder and click "Open" (double clicking won't work). The installation may be a bit slow, and the first run of `maestro` will probably be slow as well.
#### Windows
Download and install using the `.exe` installer.
Download and install using `maestro-installer.exe`.
#### Linux
Built on Ubuntu; should work on other Linux distros too. Download and unzip `maestro-ubuntu.tar.gz`. This should unzip a folder named `dist`, which contains a single folder named `maestro`. Inside `maestro` will be another folder, `_internal`, and two scripts: `maestro` and `install-maestro`. Assuming you unzipped inside `Downloads`, run
```bash
Expand Down Expand Up @@ -71,7 +71,7 @@ By default, `maestro add` copies the file to its internal database (`~/.maestro-
Playlists don't exist—`maestro` uses **tags**. For example, let's say you want to be able to listen to all your rap songs together. Instead of adding them all to a playlist, run `maestro tag <space-separated song IDs for each rap song> -t rap`. Then `maestro play rap` will play all the songs you've added the `rap` tag to. Basically, if song `s` has tag `t`, then you can think of song `s` as belonging to the playlist defined by tag `t`. The advantage of tags over playlists is that you can combine tags; `maestro play A B` will play only songs tagged `A` or `B` (add the `-M/--match-all` flag to play only songs tagged `A` *and* `B`).
### Listen Statistics
`maestro` also tracks your listen time—total and by year. You can see this with `maestro list` and/or `maestro entry`. For example, to see your top 10 listened songs this year (by average number of times listened; note that this is NOT the number of times the song was played, but rather the total listen time for that song divided by the duration), run `maestro list --reverse --sort times-listened --top 10 --year cur`—replace 'cur' with e.g. '2020' to get the listen times for 2020 instead.
![](data/list.png)
![](https://github.com/PrajwalVandana/maestro-cli/raw/master/data/list.png)
### Clips
Ever been listening to music, and you're skipping every song because you keep getting bored of them? You like the songs, you're just not in the mood to listen to all of them entirely.

Expand All @@ -94,10 +94,10 @@ Run `maestro play --visualize` or click `v` in the player session to show the vi
### Discord Status
Run `maestro play --discord` or click `d` in the player session to show the currently playing song in your Discord status (requires the Discord app to be open). Hovering over the image will show the album name. To show album art, requires signing up/logging in with `maestro signup`/`maestro login`.

<img src="data/discord.png" width="300"/>
<img src="https://github.com/PrajwalVandana/maestro-cli/raw/master/data/discord.png" width="300"/>

### Streaming
If you're logged in as `user123`, run `maestro play --stream` (or click `s` in the player session) to stream your music to `maestro-music.vercel.app/listen-along/user123`. This will show up as a "Listen Along" button on your Discord status too, if the Discord status is enabled (some versions of the Discord app don't show buttons on your own status, but it should show for everyone else).
![](data/stream.png)
![](https://github.com/PrajwalVandana/maestro-cli/raw/master/data/stream.png)
### Music Discovery
Use `maestro recommend <song ID>` to recommend similar songs (searches up the song name on YouTube Music).

0 comments on commit a37ecba

Please sign in to comment.