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

[BUG] not selecting requested music #45

Open
Olzeke51 opened this issue Jun 27, 2024 · 3 comments
Open

[BUG] not selecting requested music #45

Olzeke51 opened this issue Jun 27, 2024 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@Olzeke51
Copy link

Description

"play local music ambient" was requested [beta 27.b35] also earlier versions
received:
└── rythmic
├── Cosmic_Flux.mp3

Steps to Reproduce

beta 27.b35 - Mark II, Pi4,2G, dev-kit R6
"play local music ambient" was requested - - received other music

(venv) neon@neon:~$ tree ~/Music
/home/neon/Music
├── A_Forest
│   ├── Cold.mp3
│   ├── Dark_Beach.mp3
│   ├── Fall_in_Line.mp3
│   ├── Gotch_Yer_Gun.mp3
│   ├── Humanity.mp3
│   ├── Its_Gonna_Rain.mp3
│   ├── Jack_Jack.mp3
│   ├── Nostalgia.mp3
│   ├── Ugly_Face.mp3
│   ├── Victim_of_Myself.mp3
│   └── Willard.mp3
├── ambient
│   └── Program0110.mp3
├── mello
└── rythmic
    ├── Cosmic_Flux.mp3
    └── Program0101.mp3

5 directories, 14 files

Relevant Code

No response

Other Notes

also have noted that skill will play all files in the designated directory, regardless of genre selected
'
it is possible that I have my directory structure set up wrong, No artist, just genre

@Olzeke51 Olzeke51 added bug Something isn't working triage New issue needs review labels Jun 27, 2024
@Olzeke51
Copy link
Author

not_selected.tar.gz

@NeonDaniel
Copy link
Member

If there's no ID3 tags on the MP3 files, the skill will try to infer an Artist and Album from the directory structure; in this case it looks like it will only parse the filename into a track name.

def song_from_file_path(file: str, album_art: str = None) -> Track:
"""
Parse a song object from a file path. This expects the library to be
structured: <Artist>/<Album>/<Track No> <Track Title>.<extension>
"""
album = basename(dirname(file))
artist = basename(dirname(dirname(file)))
if 'music' in {album.lower(), artist.lower()}:
LOG.warning(f"{file} not in an expected directory structure")
album, artist = None, None
try:
track, title = splitext(basename(file))[0].split(' ', 1)
if not track.isnumeric():
track = 0
title = f'{track} {title}'
else:
track = int(track)
except ValueError:
track = None
title = splitext(basename(file))[0]
return Track(file, title, album, artist, artwork=album_art, track=track)

I can think of a couple solutions/workarounds for this kind of situation:

  • Add ID3 tags to audio to include genre, artist, and title
  • Put your entire library in a dummy "artist" directory so you can request the subdirectories as album names ("play rythmic" should then resolve all tracks in that directory

@NeonDaniel NeonDaniel added question Further information is requested and removed triage New issue needs review labels Jun 29, 2024
@Olzeke51
Copy link
Author

running beta 08_08b1 - pi4,8G,usb/sdd, hdmi (no dsi), network cable

I used yt-dlp to download some youtube music into mp3 format
then I used 'easy tag' to do author, title, genre tags.
[on these two mp3s - the tags are different.]
this display is from the linux 'tree' command.

(venv) neon@neon:~/Music$ cd ~
(venv) neon@neon:~$ tree Music
Music
├── Ambient1
│   └── Techno.mp3
└── Tribute.mp3

I asked Neon to 'play local music ambient1'
it did play Techno.mp3 and displayed (iirc) the other music tags
BUT then it jumped back a folder/dir and played Tribute !!!
[not tagged 'ambient'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants