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

Encoded files in alt are encoded again during alt update #67

Open
seadowg opened this issue Nov 4, 2021 · 7 comments
Open

Encoded files in alt are encoded again during alt update #67

seadowg opened this issue Nov 4, 2021 · 7 comments
Labels

Comments

@seadowg
Copy link

seadowg commented Nov 4, 2021

When running alt update, files that have previously been encoded (by earlier alt update runs) seem to be re-encoded. For instance, I've already run an alt update that included this version of Loveless but every time I run I see this again:

convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/01 Only Shallow.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/02 Loomer.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/03 Touched.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/04 To Here Knows When.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/05 When You Sleep.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/06 I Only Said.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/07 Come in Alone.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/03 Touched.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/08 Sometimes.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/09 Blown a Wish.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/02 Loomer.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/10 What You Want.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/07 Come in Alone.flac
convert: Encoding /my/beets/library/dir/My Bloody Valentine/Loveless/11 Soon.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/01 Only Shallow.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/05 When You Sleep.flac
convert: Finished encoding /my/beets/library/dir/My Bloody Valentine/Loveless/09 Blown a Wish.flac

I have a alt setup to convert to lossy formats from my lossless ones for my phone, and it seem to slow down and run through this encode step for every lossless track which means the process gets slower and slower every time I add an album in FLAC.

My config looks like this:

directory: /my/beets/library/dir/
library: /my/beets/library/dir/beet-library.db
plugins: convert alternatives copyartifacts
convert:
  copy_album_art: yes
  never_convert_lossy_files: yes
  formats:
    cd:
      command: ffmpeg -i $source -y -vn -sample_fmt s16 -ar 44100 $dest
      extension: flac
    mobile:
      command: ffmpeg -i $source -y -vn -ab 320k -ar 44100 $dest
      extension: mp3
alternatives:
  cloudplayer:
    directory: /my/alt/library/dir
    formats: mobile AAC aac mp3
    query: ""
    removable: true
copyartifacts:
    extensions: .pdf .jpg .png
    print_ignored: yes
@wisp3rwind
Copy link
Collaborator

What versions of beets and beets-alternatives are you running?

Re-encoding only happens when the plugin can't find the previously encoded files (or, when you change the target file format (mobile in your case)). There's no other software moving these files around after you run alt update, right?

@seadowg
Copy link
Author

seadowg commented Nov 4, 2021

What versions of beets and beets-alternatives are you running?

Looks like I'm using 1.4.9 of beets and 0.10.2.post1 of beets-alternatives.

There's no other software moving these files around after you run alt update, right?

No not as far as I know. I do sync the alt directory over Dropbox, but I tried running twice with Dropbox paused (just in case) and still see convert: Encoding lines.

@wisp3rwind
Copy link
Collaborator

I guess I'm out of real ideas on what's going on here... a few things to try might be

  • run beets in verbose mode (-vv), although I doubt that the log will provide useful details
  • What type of file system is this on?
  • Manually inspect the destination folders: Do the destination files show up? Do they have the expected file names/extensions (mp3)?

@seadowg
Copy link
Author

seadowg commented Nov 5, 2021

What type of file system is this on?

On a MacBook Pro running Big Sur, so it's APFS. I guess the one quirk I know off the top of my head if the case insensitivity and I definitely have capitalized dir names in my paths (Dropbox for instance).

On thing that's interesting running with verbose mode is that it looks like the mp3s are copying as well:

alternatives: copying /my/alt/library/dir/Jacques Greene/Phantom Vibrate EP/01 No Excuse.mp3

I don't know if you'd expect that log or not if the file is already there. Inspecting the directory, it does seem to be:

> ls /my/alt/library/dir/Jacques Greene/Phantom Vibrate EP/
01 No Excuse.mp3	02 Feel What.mp3	03 Night Tracking.mp3

Also inspecting the alt library for something that's been converted:

convert: Finished encoding /my/beets/library/dir/YOB/Atma (Deluxe Edition)/05 Adrift In The Ocean (2021 Mix).flac
> ls my/alt/library/dir/YOB/Atma\ \(Deluxe\ Edition\)
01 Prepare The Ground (2021 Mix).mp3
02 Atma (2021 Mix).mp3
03 Before We Dreamed Of Two (2021 Mix).mp3
04 Upon The Sight Of The Other Shore (2021 Mix).mp3
05 Adrift In The Ocean (2021 Mix).mp3

@wisp3rwind
Copy link
Collaborator

On a MacBook Pro running Big Sur, so it's APFS. I guess the one quirk I know off the top of my head if the case insensitivity and I definitely have capitalized dir names in my paths (Dropbox for instance).

Case-(in)sensitivity sounds like a plausible reason for this (although I don't yet see how exactly).

On thing that's interesting running with verbose mode is that it looks like the mp3s are copying as well:

alternatives: copying /my/alt/library/dir/Jacques Greene/Phantom Vibrate EP/01 No Excuse.mp3

I don't know if you'd expect that log or not if the file is already there. Inspecting the directory, it does seem to be:

That's similar to the unexpected conversions; shouldn't happen if the file is already there and in the correct format.

> ls /my/alt/library/dir/Jacques Greene/Phantom Vibrate EP/
01 No Excuse.mp3	02 Feel What.mp3	03 Night Tracking.mp3

Also inspecting the alt library for something that's been converted:

convert: Finished encoding /my/beets/library/dir/YOB/Atma (Deluxe Edition)/05 Adrift In The Ocean (2021 Mix).flac
> ls my/alt/library/dir/YOB/Atma\ \(Deluxe\ Edition\)
01 Prepare The Ground (2021 Mix).mp3
02 Atma (2021 Mix).mp3
03 Before We Dreamed Of Two (2021 Mix).mp3
04 Upon The Sight Of The Other Shore (2021 Mix).mp3
05 Adrift In The Ocean (2021 Mix).mp3

Nothing suspicious here.


You mentioned running 0.10.2.post1. Where is that coming from? The post1 suffix does not exist for an official release, is it a version that was modified by someone else?

@seadowg
Copy link
Author

seadowg commented Nov 5, 2021

Case-(in)sensitivity sounds like a plausible reason for this (although I don't yet see how exactly).

Yeah, it feels like it could be a problem. Are you testing on Linux/Windows? If you point me in the right direction maybe there's some code we can try debugging on Mac to check out whether the "file already exists" logic has problems with the case.

That's similar to the unexpected conversions; shouldn't happen if the file is already there and in the correct format.

Ok that makes me feel better. At least it's consistent.

You mentioned running 0.10.2.post1. Where is that coming from? The post1 suffix does not exist for an official release, is it a version that was modified by someone else?

If I do python3 -m pip install --user beets-alternatives, I get:

Downloading beets-alternatives-0.10.2.post1.tar.gz (10 kB)
.
.
.
Building wheels for collected packages: beets-alternatives
  Building wheel for beets-alternatives (setup.py) ... done
  Created wheel for beets-alternatives: filename=beets_alternatives-0.10.2.post1-py3-none-any.whl size=11042 sha256=0780de20ee99c65ccade736f8cf3c5a7ccbaa68b7ccbb2f6963cc9a1d63150f2

I omitted all the extra dependency checking in the output. Does that not look right? Sorry I've not done much python dev in my life so very much inexperienced when it comes to pip. It does look post1 is the latest version on https://pypi.org though: https://pypi.org/project/beets-alternatives/#history. Is that not expected?

@wisp3rwind
Copy link
Collaborator

Case-(in)sensitivity sounds like a plausible reason for this (although I don't yet see how exactly).

Yeah, it feels like it could be a problem. Are you testing on Linux/Windows? If you point me in the right direction maybe there's some code we can try debugging on Mac to check out whether the "file already exists" logic has problems with the case.

Yes, and there seem to be more problems on case-insensitive filesystems anyway: #66
Gathering more detailed debug logs seems like the way to go, but I'd have to think about what to actually look for. Not sure whether I'll find the time to do so soon.

I omitted all the extra dependency checking in the output. Does that not look right? Sorry I've not done much python dev in my life so very much inexperienced when it comes to pip. It does look post1 is the latest version on https://pypi.org though: https://pypi.org/project/beets-alternatives/#history. Is that not expected?

Oh, that was probably due to #64; sorry for the fuss!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants