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

WIP: preliminary git-annex support #146

Closed
wants to merge 1 commit into from

Conversation

anarcat
Copy link

@anarcat anarcat commented Apr 4, 2019

Supysonic doesn't deal well with git-annex (GA)
repositories. Because GA stores files as symlinks to an object storage
in .git/annex/objects, all the normal Artist/Album/File.mp3 files
are ignored and instead the actual files in .git are parsed.

Those files have funky filenames based on the file hash, for example:

.git/annex/objects/xm/zw/SHA256E-s1093632--6dc57e45ba7f81ed48ab6e581335bd2fb6271e40934c97931c6684cea3eec0b9.mp3/SHA256E-s1093632--6dc57e45ba7f81ed48ab6e581335bd2fb6271e40934c97931c6684cea3eec0b9.mp3

This makes most Supysonic client show the garbled filename instead of
the song title and breaks most album grouping behavior.

This patch makes the scanner follows symlinks when scanning and
ignores hidden directories (so .git). It's a WIP for now because
ideally the parser would be rewritten to use the faster os.walk and
support arbitrary ignore patterns or enable the user to configure
whether symlinks must be followed (see also #144).

But I've been using this patch on my side and it works sufficiently
well.

@codecov-io
Copy link

codecov-io commented Apr 4, 2019

Codecov Report

Merging #146 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
+ Coverage   94.58%   94.61%   +0.03%     
==========================================
  Files          28       28              
  Lines        2657     2655       -2     
==========================================
- Hits         2513     2512       -1     
+ Misses        144      143       -1
Impacted Files Coverage Δ
supysonic/scanner.py 96% <100%> (+0.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 270fa98...023c9cc. Read the comment docs.

Supysonic doesn't deal well with [git-annex][] (GA)
repositories. Because GA stores files as symlinks to an object storage
in `.git/annex/objects`, all the normal `Artist/Album/File.mp3` files
are ignored and instead the actual files in `.git` are parsed.

 [git-annex]: https://git-annex.branchable.com/

Those files have funky filenames based on the file hash, for example:

```
.git/annex/objects/xm/zw/SHA256E-s1093632--6dc57e45ba7f81ed48ab6e581335bd2fb6271e40934c97931c6684cea3eec0b9.mp3/SHA256E-s1093632--6dc57e45ba7f81ed48ab6e581335bd2fb6271e40934c97931c6684cea3eec0b9.mp3
```

This makes most Supysonic client show the garbled filename instead of
the song title and breaks most album grouping behavior.

This patch makes the scanner follows symlinks when scanning and
ignores hidden directories (so `.git`). It's a WIP for now because
ideally the parser would be rewritten to use the faster `os.walk` and
support arbitrary ignore patterns or enable the user to configure
whether symlinks must be followed.

But I've been using this patch on my side and it works sufficiently
well.
spl0k added a commit that referenced this pull request Jul 6, 2019
@spl0k
Copy link
Owner

spl0k commented Jul 7, 2019

007a6e1 and f3a12c7 should do the trick. Is there something more to do to solve your issues?

@anarcat
Copy link
Author

anarcat commented Jul 7, 2019

that looks awesome, thanks!

@anarcat anarcat closed this Jul 7, 2019
@anarcat anarcat deleted the git-annex-support branch July 7, 2019 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants