Files
MusicFS/docs
Alexander f8666ae8c6 Document test findings and fix mount script
Test Results (74 tests):
- 12 passed, 56 failures, 3 errors, 3 skipped

Bugs Detected:
1. Nested methods bug: lines 758-1144 indented inside access()
   - FUSE operations (readdir, open, read, write) unreachable
   - os.listdir() returns ENOSYS (Function not implemented)

2. Directory tree building: KeyError in FSNode.getnode()
   - Mount fails when library contains tracks

3. Unmount not clean: filesystem not releasing properly

Changes:
- Fix conftest.py: inline sanitization (no module-level sanitize fn)
- Add test findings to e2e-test-plan.md
- Add .gitignore for .pyc and test artifacts
2026-05-12 14:29:05 +02:00
..
2026-05-12 11:52:48 +02:00

beetfs - Reverse Engineered Documentation

Status: Archived project (2010-2013), Python 2, fuse-python API Fork: git@github.com:LichHunter/beetfs.git Original: https://github.com/jbaiter/beetfs

Overview

beetfs is a FUSE filesystem that presents audio files with metadata from a database while passing through audio data unchanged from original files. This enables transparent metadata modification without touching the underlying files.

The Core Concept

┌─────────────────────────────────────────────────────────────────────┐
│                        APPLICATION (VLC, Jellyfin, etc.)            │
│                                                                     │
│                     read("/mount/Artist/Album/track.flac")          │
└─────────────────────────────────┬───────────────────────────────────┘
                                  │
                                  ▼
┌─────────────────────────────────────────────────────────────────────┐
│                           beetfs (FUSE Layer)                        │
│  ┌────────────────────────────────────────────────────────────────┐ │
│  │                        FileHandler                              │ │
│  │  ┌──────────────────────────────────────────────────────────┐  │ │
│  │  │  if offset < header_boundary:                             │  │ │
│  │  │      return MODIFIED_HEADER (from beets database)         │  │ │
│  │  │  else:                                                    │  │ │
│  │  │      return ORIGINAL_AUDIO (from real file on disk)       │  │ │
│  │  └──────────────────────────────────────────────────────────┘  │ │
│  └────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
                    │                               │
        ┌───────────┘                               └───────────┐
        ▼                                                       ▼
┌───────────────────┐                               ┌───────────────────┐
│   Beets Database  │                               │   Original File   │
│  (SQLite - tags)  │                               │   (untouched)     │
│                   │                               │                   │
│  title: "Fixed"   │                               │  [FLAC header]    │
│  artist: "Corr"   │                               │  [Audio frames]   │
│  album: "Right"   │                               │                   │
└───────────────────┘                               └───────────────────┘

Key Features

Feature Description
Metadata Overlay Returns tags from database, not from file
Audio Passthrough Original audio data served unchanged
Write Interception Tag edits saved to database, not to file
Virtual Organization Presents files in template-based directory structure
Format Support FLAC (full), MP3 (partial - read-only)

File Structure

beetfs/
├── beetsplug/
│   ├── __init__.py      # Package initialization
│   └── beetFs.py        # ALL code (~1144 lines)
├── README.rst           # Original readme
└── COPYING              # GPLv3 license

Quick Architecture Summary

Component Lines Purpose
beetFs (plugin) 188-191 Beets plugin hook
mount() 119-183 CLI entry point, builds virtual tree
FSNode 390-436 Virtual directory tree node
FileHandler 439-565 CORE: Metadata interpolation
InterpolatedFLAC 274-388 FLAC header generation
InterpolatedID3 200-271 ID3 tag generation (incomplete)
beetFileSystem 622-1144 FUSE operations implementation
Stat 568-619 File stat structure

Documentation Index

  1. Architecture Overview - System design and component interaction
  2. Components Deep Dive - Detailed component analysis
  3. Data Flow - Read/write operation flows
  4. Performance Analysis - Latency, memory footprint, I/O patterns
  5. Drawbacks & Limitations - Known issues and missing features
  6. Modernization Guide - Notes for updating to Python 3

Critical Issues Summary

Issue Severity Impact
Full file loaded into RAM 🔴 Critical OOM on large libraries
MP3 support disabled 🔴 Critical Only FLAC works
Python 2 only 🔴 Critical EOL, security risk
Single-threaded 🟡 Major Poor concurrency
4 of 17 metadata fields 🟡 Major Limited functionality

See drawbacks.md for complete list (27 identified issues).

Dependencies (Original)

beets >= 1.0
fuse-python (Python 2 FUSE bindings)
mutagen (audio metadata library)

Usage (Original)

# As beets plugin
beet mount /path/to/mountpoint

License

GPLv3 - See COPYING file