Git Product home page Git Product logo

trackfs's Introduction

trackfs

trackfs is a read-only FUSE filesystem that splits audio files that contain full albums into individual FLAC files per track.

trackfs supports three flavors of album files:

  • FLAC files with embedded cuesheets (FLAC+CUE)
  • FLAC files with accompanying cuesheet
  • WAVE files with accompanying cuesheet

Accompanying cuesheets must use the fileextension .cue and have the same basename as album file.

The recommended way to use trackfs is using the docker image andresch/trackfs. In case you want to use trackfs without docker see section Manual Installation below.

Usage

You can directly run trackfs on any Linux system with Docker and FUSE installed.

Getting started

The simplest way to get familiar with trackfs is to just launch it from the command-line:

docker run --rm \
    --name=trackfs \
    --device /dev/fuse \
    --cap-add SYS_ADMIN \
    --security-opt apparmor:unconfined \
    -v /path/to/yourmusiclibrary:/src:ro \
    -v /path/to/yourmountpoint:/dst:rshared \
    andresch/trackfs \
    --root-allowed

Replace /path/to/yourmusiclibrary with the root directory where trackfs scans for your album files and /path/to/yourmountpoint with the directory that you want to use as mount point for the trackfs-filesystem. Ideally the mount point already exists, if not, docker will create the directory (but then with root as owner)

Once started you will find all directories and files from your music library also in the trackfs-filesystem. Only album files got replaced: Instead of a single album file you will find individual FLAC files for each track found in the cue sheet. The track-files will have the following names:

{album-file}.#-#.{tracknumber}.{track-title}.flac

While the tracks can be used like regular files, they don't exist in the physical file system on your machine. Instead trackfs creates them on the fly whenever an application starts loading any of the track files. This usually takes (depending on your system) a few seconds.

Docker arguments

In case you're not familiar with docker, a quick explanation on the used docker arguments:

  • -v /path/to/yourmusiclibrary:/src:ro: make your music library accessible for trackfs by mounting it to /src in read-only mode inside your docker container
  • -v /path/to/yourmountpoint:/dst:rshared: share the trackfs filesystem (/dst inside the container) accessible under your mount point
  • andresch/trackfs: the name of the trackfs docker image on docker hub.
  • --device, --cap-add --security-opt: With those arguments you grant the docker container the privileges required to mount FUSE filesystems. You can try to leave out the --security-opt option as it is not required on all systems. There is onging discussion if docker containers should allow mounting FUSE filesystems, by just using the --device option, but for now this is not the case.
  • --rm: remove the orphaned container after termination

Please refer to the docker run documentation for more details.

Running trackfs as regular user

While the above is working just fine, it is not the recommended way to use trackfs as it runs trackfs inside the docker container as user root. Running as root does allow trackfs to access any file in your music library, irrespective of its underlying file permissions. If we would have omitted the --root-allowed argument, trackfs would have terminated with a corresponding error message.

Instead it is recommended to let trackfs run as a regular user. For that to work we need a few changes:

  • Make sure that in your host system the file /etc/fuse.conf has the option user_allow_other enabled, e.g. by calling from your command line sudo echo "user_allow_other" >> /etc/fuse.conf

  • Make sure that your mount point already exists and is owned by the user that is supposed to run trackfs.

  • Use the docker run option --user to define the user that will run trackfs

    E.g. the following docker command would run trackfs with the current user:

    docker run --rm \
      --name=trackfs \
      --device /dev/fuse \
      --cap-add SYS_ADMIN \
      --security-opt apparmor:unconfined \
      --user $(id -u):$(id -g) \
      -v /path/to/yourmusiclibrary:/src:ro \
      -v /path/to/yourmountpoint:/dst:rshared \
      andresch/trackfs 
    

All trackfs options

trackfs provides a few options that allow you to tweak its default behavior:

  • -e EXTENSION, --extension EXTENSION (default: "(\.flac|\.wav)") : A regular expression matching file extension of album files in the music library
  • -s SEPARATOR, --separator SEPARATOR (default: ".#-#."): The separator used inside the name of the track-files. Must never occur in regular filenames
  • -i IGNORE, --ignore-tags IGNORE (default: "CUE_TRACK.*|COMMENT"): A regular expression matching all tags in the FLAC+CUE file that will not be copied over to the track FLACs
  • -k, --keep-album: Keep the source album file (FLAC+CUE or WAVE) in the trackfs filesystem in addition to the individual tracks
  • -t TITLE_LENGTH, --title-length TITLE_LENGTH (default: 20): Nr. of characters of the track title in filename of track
  • --root-allowed: Allow running trackfs as with root permissions; Neither necessary nor recommended. Use only when you know what you are doing
  • -v, --verbose: Activate info-level logging
  • -d, --debug: Activate debug-level logging

You can use -h, --help to get a list of all all options. Keep in mind that the parameters root and mount are already defined with the two -v options to docker run and are implicitly set by the docker container.

Meta-Data in in Track Files

Most tags of the album file will be set in the track files too. There are only two exceptions:

  • Tags that contain multi-line values (like the CUESHEET-tag)
  • Any tag whose name matches the regular expression of the --ignore-tags option (default: "CUE_TRACK.*|COMMENT")

In addition trackfs does the following modifications to tags:

  • If the album file contains an ARTIST tag but no ALBUMARTIST tag, then an ALBUMARTIST tag will be created with the value of ARTIST tag.
  • If the album file contains a TITLEtag, but no ALBUM tag, then an ALBUM tag will be created with the value of the TITLE tag.
  • If the cue sheet contains a TITLE tag for a given track, it overwrites the TITLE tag from the album file
  • If the cue sheet contains a PERFORMER tag for a given track, it overwrites the ARTIST tag from the album file
  • If the cue sheet contains a SONGWRITER tag for a given track, it overwrites the COMPOSER tag from the album file
  • Any other information from the cue sheet will only be used to add their missing corresponding tags from the audio file, but never to overwrite an existing tag.

Cue sheet entries of type PERFORMER, SONGWRITER will be split at ";" characters and create multiple tags in the track file.

In case the album has embedded pictures, the first picture will be available in the track file. Alternatively trackfs will scan the directory for a jpg-file with the same basename as the album file or a file named folder.jpg

Manual Installation

In case you want/have to run trackfs on some linux system without docker you can also install the python package trackfs manually. Please refer to the homepage of the trackfs python package for further information.

Status

trackfs is currently in an early stage. While it runs stable on the author's NAS, it has not been tested in other environments, esp. on various Linux distributions with different kernels/FUSE versions. Using the dockerized version should remove some of the difficulties, but given the dependencies on FUSE, some my still remain.

Also keep in mind that this is the author's first python project, so don't expect that the source code matches professional quality criteria of experienced python coders.

Future improvements:

There are a few ideas for additional improvements

  • Find out if there is a way to extract tracks from the FLAC+CUE file without re-encoding the track. This should allow to increase the performance when starting to read a track massively
  • Allow encoding in other audio-formats (esp. mp3). While you can create a FUSE chain, by using mp3fs with the trackfs filesystem as source, the performance of that approach is not very compelling and a unified solution might provide bette results. (ffmpegfs has picked up the idea of cuesheets for splitting and transcoding; currently only in dev branch, but soon on master. No need to reinvent the wheel)

Troubleshooting

When trackfs doesn't get properly terminated, then your system might still have an orphaned mount point. When you then restart trackfs this will fail with a corresponding error message.

In that case you have to first unmount the orphaned mount point by calling:

sudo umount /path/to/yourmountpoint

In case the path to your mountpoint contains a symbolic link the above might not work as umount expects the real path of the mount point. In that case use

mount -t fuse

to find the path that umount expects.

In case trackfs hangs (should not happen, but just in case) you might have to explicitly kill it. For that we use the docker stop command (which give the container a chance to currently shutdown before killing it). This requires the container name or container id as parameter.

If you have defined a container name (e.g. to "trackfs") you can just use

docker stop trackfs

otherwise your first have to find the id of the container that runs the andresch/trackfs image:

docker stop $(docker ps | awk '/andresch\/trackfs/{print $1}')

Acknowledgments

trackfs began its live as a clone of FLACCue. While FLACCue is designed for the usage with the Plex media server, the underlying idea of both projects is the same. Although there is little unmodified code of FLACCue left in trackfs, the project would most likely not have been started without the ideas in this groundwork. Kudos go to acenkos!

License

trackfs is licensed under the terms of the GNU Lesser General Public License v3.0

trackfs's People

Contributors

andresch avatar igor-epam avatar kobarity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

trackfs's Issues

path /mnt/mdisc is mounted on / but it is not a shared mount

docker run -d --name trackfs --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined -v /mnt/sdb2/test:/src:ro -v /mnt/mdisc:/dst:rshared andresch/trackfs --root-allowed

how can I get this problem fixed,thank you very much.

Option to create a saved cue file?

Hello. I don't see an option to save the cue sheet (file) that tracksf creates. My goal is to actually split the flac into its tracks (for which I can use one of several tools). I just found trackfs which I see can read the embedded cue sheet. If there is currently an option to save it, I did not see it.

If that option does not exist please consider it as a new feature. Alternatively, if you recommend some other Linux tools for this, could you let me know?

What are your thoughts? Thank you.

Trackfs fails totally if directory name ends with .flac|.wav

IsADirectoryError: [Errno 21] Is a directory: '/src/Rod.Stewart-The.Best.Of.Rod.Stewart.1971.Flac'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper
return func(*args, **kwargs) or 0
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 960, in readdir
for item in self.operations('readdir', self._decode_optional_path(path),
File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in call
return super(TrackFSOps, self).call(op, self.root + path, *args)
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1076, in call
return getattr(self, op)(*args)
File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 127, in readdir
return self._fusepath(path).readdir()
File "/usr/local/lib/python3.8/site-packages/trackfs/fusepath.py", line 145, in readdir
trx = albuminfo.get(os.path.join(self.source, filename)).tracks()
File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 78, in tracks
return self.cue.tracks if self.cue is not None else []
File "/usr/local/lib/python3.8/functools.py", line 967, in get
val = self.func(instance)
File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 63, in cue
meta = self.meta
File "/usr/local/lib/python3.8/functools.py", line 967, in get
val = self.func(instance)
File "/usr/local/lib/python3.8/site-packages/trackfs/albuminfo.py", line 37, in meta
return File(self.path)
File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 162, in wrapper_func
with _openfile(None, filething, filename, fileobj,
File "/usr/local/lib/python3.8/contextlib.py", line 113, in enter
return next(self.gen)
File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 272, in _openfile
raise MutagenError(e)
mutagen.MutagenError: [Errno 21] Is a directory: '/src/Rod.Stewart-The.Best.Of.Rod.Stewart.1971.Flac'
INFO Dummy-3 getattr for (/src/autorun.inf) [None]
DEBUG Dummy-3 no track file in "/src/autorun.inf"
DEBUG Dummy-3 FusePath(source_root='/src/autorun', extension='.inf', is_track=False, num=None, title=None, factory=Factory(track_separator='.#-#.', max_title_len=20, album_extension='(?i:\.flac|\.wav)', valid_filename_chars='-() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', keep_album=False, track_extension='.flac'))
DEBUG Dummy-3 FUSE operation getattr raised a <class 'FileNotFoundError'>, returning errno 2.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper
return func(*args, **kwargs) or 0
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 774, in getattr
return self.fgetattr(path, buf, None)
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1027, in fgetattr
attrs = self.operations('getattr', self._decode_optional_path(path), fh)
File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in call
return super(TrackFSOps, self).call(op, self.root + path, *args)
File "/usr/local/lib/python3.8/site-packages/fuse.py", line 1076, in call
return getattr(self, op)(*args)
File "/usr/local/lib/python3.8/site-packages/trackfs/fuseops.py", line 69, in getattr
st = os.lstat(fp.source)
FileNotFoundError: [Errno 2] No such file or directory: '/src/autorun.inf'

Pre-extract next track

Extracting a track might take up to a few seconds. If your media player doesn't prefetch the next track early enough, then gapless playback might not work. By extracting the next track already towards the end of the previous track, it would already wait for being streamed on the cash and reduce the lead time for reading the next track to the time it takes frackfs to open the file from cache.

Vinyl record FLAC with accompanying CUE file doesn't split

First of all, thank you so much for this container! I got it working perfectly fine for CD FLAC rips but I noticed for some reason rips that are sourced from vinyl records do not split. The CUE files work fine in Foobar2000 + other apps but this doesn't split them. I thought it was maybe because most vinyl record rips have at least 2 FLAC files (one for each side of the LP, sometimes multiple LPs per album) index by 1 CUE file. As a test I modified a CUE file to get rid of the second FLAC but it didn't have any effect.

Thanks!

Wrong file size after splitting into tracks

Hello.
Thank you for the excellent program!
I use it to distribute a small music collection (FLAC Image+CUE) via DLNA (minidlna) for playback on LG TV.
Mostly everything works fine, but after dividing some albums into tracks, trackfs reports the wrong file sizes for individual tracks.

Here is the track information from the Fuse file system and the mediainfo output for one of the tracks:

server /mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) # ls -l
total 0
-rw-rw-r-- 1 p2p p2p     2989 дек 10  2022 'Dark Side Of The Moon.log'
-rw-rw-r-- 1 p2p p2p     1062 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.cue'
-rw-rw-r-- 1 p2p p2p 31834908 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.001.Speak To M.flac'
-rw-rw-r-- 1 p2p p2p 37622592 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.002.On The Run.flac'
-rw-rw-r-- 1 p2p p2p 75372192 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.003.Time.flac'
-rw-rw-r-- 1 p2p p2p 50169924 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.004.The Great .flac'
-rw-rw-r-- 1 p2p p2p 69222888 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.005.Money.flac'
-rw-rw-r-- 1 p2p p2p 81401544 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.006.Us And The.flac'
-rw-rw-r-- 1 p2p p2p 36359568 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.007.Any Colour.flac'
-rw-rw-r-- 1 p2p p2p 40681368 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.008.Brain Dama.flac'
-rw-rw-r-- 1 p2p p2p 21928284 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.009.Eclipse.flac'
drwxrwxr-x 2 p2p p2p     4096 дек 10  2022  Диск
server /mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) #
server /mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) # mediainfo Pink\ Floyd\ -\ Dark\ Side\ Of\ The\ Moon.flac.009.Eclipse.flac 
General
Complete name                            : Pink Floyd - Dark Side Of The Moon.flac.009.Eclipse.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 20.9 MiB
Duration                                 : 2 min 4 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 410 kb/s
Album                                    : Dark Side Of The Moon
Album/Performer                          : Pink Floyd
Track name                               : Eclipse
Track name/Position                      : 9
Track name/Total                         : 9
Performer                                : Pink Floyd
Composer                                 : Pink Floyd
DISCID                                   : 6F0A1509

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 2 min 4 s
Bit rate mode                            : Variable
Bit rate                                 : 1 410 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Compression mode                         : Lossless
Stream size                              : 20.9 MiB (100%)
Writing library                          : libFLAC 1.3.3 (2019-08-04)
MD5 of the unencoded content             : 40F74FD99EC4C887785C3947D1DFEDF0



server /mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) #

This file gives an error when played (here is part of the minidlna log):

[2023/10/05 07:11:35] minidlna.c:170: debug: HTTP connection from 192.168.2.56:56860
[2023/10/05 07:11:35] upnphttp.c:264: debug: Range Start-End: 12713984 - -1
[2023/10/05 07:11:35] clients.c:357: debug: Client found in cache. [LG/entry 0]
[2023/10/05 07:11:35] upnphttp.c:916: debug: HTTP REQUEST: GET /MediaItems/39384.flac HTTP/1.1
Host: 192.168.2.1:8200
User-Agent: Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 WebAppManager
Connection: close
icy-metadata: 1
Range: bytes=12713984-


[2023/10/05 07:11:35] upnphttp.c:1998: info: Serving DetailID: 39384 [/mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  )/Pink Floyd - Dark Side Of The Moon.flac.009.Eclipse.flac]
[2023/10/05 07:11:35] upnphttp.c:2064: warn: Specified range was invalid!
[2023/10/05 07:11:35] upnphttp.c:1277: debug: HTTP RESPONSE: HTTP/1.1 400 Bad Request
Content-Type: text/html
Connection: close
Content-Length: 136
Server: 6.1.41-gentoo DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.3.3
Date: Thu, 05 Oct 2023 04:11:35 GMT
EXT:

<HTML>
    <HEAD>
        <TITLE>400 Bad Request</TITLE>
    </HEAD>
    <BODY>
        <H1>Bad Request</H1>The request is invalid for this HTTP version.</BODY>
</HTML>

If I copy the same files from the Fuse file system to a real hard drive, then the copied files are smaller in size, mediainfo shows a smaller size and a different bitrate:

server /mnt/1/torrents/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) # ls -l
total 265476
-rw-rw-r-- 1 p2p p2p     2989 дек 10  2022 'Dark Side Of The Moon.log'
-rw-rw-r-- 1 p2p p2p     1062 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.cue'
-rw-rw-r-- 1 p2p p2p 23214518 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.001.Speak To M.flac'
-rw-rw-r-- 1 p2p p2p 21382110 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.002.On The Run.flac'
-rw-rw-r-- 1 p2p p2p 44669457 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.003.Time.flac'
-rw-rw-r-- 1 p2p p2p 26696409 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.004.The Great .flac'
-rw-rw-r-- 1 p2p p2p 46425658 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.005.Money.flac'
-rw-rw-r-- 1 p2p p2p 49211303 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.006.Us And The.flac'
-rw-rw-r-- 1 p2p p2p 22555369 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.007.Any Colour.flac'
-rw-rw-r-- 1 p2p p2p 25073379 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.008.Brain Dama.flac'
-rw-rw-r-- 1 p2p p2p 12587210 дек 10  2022 'Pink Floyd - Dark Side Of The Moon.flac.009.Eclipse.flac'
drwxrwxr-x 2 p2p p2p     4096 дек 10  2022  Диск
server /mnt/1/torrents/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) #
server /mnt/1/torrents/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) # mediainfo Pink\ Floyd\ -\ Dark\ Side\ Of\ The\ Moon.flac.009.Eclipse.flac 
General
Complete name                            : Pink Floyd - Dark Side Of The Moon.flac.009.Eclipse.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 12.0 MiB
Duration                                 : 2 min 4 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 809 kb/s
Album                                    : Dark Side Of The Moon
Album/Performer                          : Pink Floyd
Track name                               : Eclipse
Track name/Position                      : 9
Track name/Total                         : 9
Performer                                : Pink Floyd
Composer                                 : Pink Floyd
DISCID                                   : 6F0A1509

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 2 min 4 s
Bit rate mode                            : Variable
Bit rate                                 : 809 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Compression mode                         : Lossless
Stream size                              : 12.0 MiB (100%)
Writing library                          : libFLAC 1.3.3 (2019-08-04)
MD5 of the unencoded content             : 40F74FD99EC4C887785C3947D1DFEDF0



server /mnt/raid/Музыка/Pink Floyd - Dark Side Of The Moon 1973 ( SomeWax 2002г.  ) #

These files play normally.

Here is a link to the original files to check (FLAC Image+CUE):
https://drive.google.com/file/d/11Dp453WCW6Lk3jD_7Cwiku6pJ2_2Tocp/view?usp=sharing

trackfs.flactracks.FlacSplitException: failed to extract track #1 from file

Hi,

This is a very neat tool. Congratulations and thanks!
I have been able to mount a single WAV+CUE file as a list of individual FLAC tracks and it plays just fine! ;-)

However, when I try to do the same with the single FLAC+CUE file (for the same album, the FLAC file being derived from the above WAV file), I get this error as soon as I try to play one track with ffplay from another terminal.

Any help or idea is welcome!

Cheers

Tested on Ubuntu 20.04 and with trackfs built using pip3.

$ trackfs /home/beuguissime/riptest /home/beuguissime/ripfs
Type "flac" for a usage summary or "flac --help" for all options
failed to extract track #1 from file "/home/beuguissime/riptest/WZi7lDz2DeUOBowkh8DNLwHcH5A-.flac"
Uncaught exception from FUSE operation open, returning errno.EINVAL.
Traceback (most recent call last):
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 734, in _wrapper
    return func(*args, **kwargs) or 0
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 834, in open
    fi.fh = self.operations('open', path.decode(self.encoding),
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/fuseops.py", line 60, in __call__
    return super(TrackFSOps, self).__call__(op, self.root + path, *args)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/fuse.py", line 1076, in __call__
    return getattr(self, op)(*args)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/fuseops.py", line 94, in open
    path = self.tracks.prepare_track(path, fp)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/flactracks.py", line 273, in prepare_track
    return self._extract_flac_track(path, fp, album_info)
  File "/home/beuguissime/.local/lib/python3.8/site-packages/trackfs/flactracks.py", line 196, in _extract_flac_track
    raise FlacSplitException(err_msg)
trackfs.flactracks.FlacSplitException: failed to extract track #1 from file "/home/beuguissime/riptest/WZi7lDz2DeUOBowkh8DNLwHcH5A-.flac"

Attributes of CueSheet object are included as tags in track files

Current trackfs shows all attributes including methods of CueSheet object as tags. Here are excerpts from "metaflac --list" for a track file.

    comment[41]: __ANNOTATIONS__={'tracks': typing.List[ForwardRef('Track')], 'albumartists': typing.List[str], 'album': <class 'str'>, 'composers': typing.List[str], 'catalog': <class 'str'>, 'discid': <class 'str'>, 'year': <class 'str'>, 'discnumber': <class 'str'>, 'totaldiscs': <class 'str'>}
    comment[42]: __CLASS__=<class 'trackfs.cuesheet.CueSheet'>
...
    comment[50]: __FORMAT__=<built-in method __format__ of CueSheet object at 0x7f9106e90580>
    comment[51]: __GE__=<method-wrapper '__ge__' of CueSheet object at 0x7f9106e90580>

This is caused by the following code in the CueSheet class.

    def tags(self):
        return TagTools.object_tags(self, dir(self).remove('tracks'))

Please note that the list's remove() method always returns None. TagTools.object_tags() calls dir(o) when names argument is None, which results in names to be all attributes/methods of CueSheet object.

Custom file-names formats?

Hello,
the default file-names are
{album-file}.#-#.{tracknumber}.{track-title}.flac

That produces very long file-names though. Would it be possible to specify to have something like

{tracknumber}.{track-title}.flac ?

As a beginner I tried to give a look into trackfs/fusepath.py and editing 53, but with no results.

Feature Request: wav Support?

Many of the files in my music library are .wav which would be great if possible. I'm not sure how difficult it would be, but .wav support would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.