How juancho033/juantune works
Purpose and entry point
JuanTune is a Python music-player application with local playback, library/state persistence, and optional cloud-backed media/cache integrations. The primary application bootstrap is main.py; packaging is defined by JuanTune.spec. Administrative cloud upload work is separated into admin_upload.py.
Application orchestration
core/manager.py is the likely coordination layer between UI actions, player control, library/history state, and service-backed media acquisition. core/player.py owns playback-facing behavior and forms the principal boundary between application logic and the underlying audio runtime.
Paths: main.py, core/manager.py, core/player.py
Presentation layer
The UI is isolated under ui/, suggesting the rest of the application should interact through view/component events rather than directly manipulating widgets. ui/views.py likely defines screens or major panels; ui/components.py provides reusable controls; ui/styles.py centralizes presentation rules.
Paths: ui/views.py, ui/components.py, ui/styles.py
Local data and user state
The data/ package separates durable application concerns from playback and UI logic. Database access is centralized in data/database.py; filesystem locations and storage layout are established in data/paths.py; user-facing listening history and aggregate metrics are represented by data/recent.py and data/stats.py.
Primary local flow: manager/player events update recent-track and statistics state, which is persisted through the database/path layer and then reflected in views.
Paths: data/database.py, data/recent.py, data/stats.py
Media retrieval and caching
Media access is abstracted behind service modules rather than embedded in player logic. services/stream_cache.py appears to manage transient or stream-oriented cached content, while services/cloud_cache.py likely maintains locally reusable copies of cloud media. This creates an important boundary: the player should consume resolved local/streamable media, while service code handles remote fetch, cache validity, and storage.
Paths: services/stream_cache.py, services/cloud_cache.py, core/player.py
External cloud integrations
Three dedicated adapters indicate supported backend providers: Cloudinary for hosted media, Google Drive for remote file access, and Firebase for application/cloud data. Credentials are expected outside source control through example configuration files.
Paths: services/cloudinary_service.py, services/drive_service.py, services/firebase_service.py
Relevant external configuration: cloudinary_config.example.json, drive_oauth.example.json, firebase_config.example.json
Configuration and control flow
config.py is the central configuration boundary and should supply environment- or file-derived settings to data and service layers. A typical control path is: main.py initializes configuration, persistence, services, manager, and UI; UI commands flow to core/manager.py; the manager invokes playback or media services; state changes persist through data/ and update the UI.
Paths: config.py, main.py, core/manager.py
Main entry points: config.py Configuration · views.py Views · manager.py Playback manager · player.py Player
Components 17
Application
- Application bootstrap
main.py - Configuration
config.py - Playback manager · Coordinates UI commands, playback, media acquisition, and state.
core/manager.py - Player · Owns playback-facing behavior and audio runtime interaction.
core/player.py
Presentation
- Views
ui/views.py - UI components
ui/components.py - UI styles
ui/styles.py
Local state
- Database
data/database.py - Storage paths
data/paths.py - Recent history
data/recent.py - Listening statistics
data/stats.py
Media services
- Stream cache · Resolves transient or stream-oriented media.
services/stream_cache.py - Cloud cache · Maintains reusable local copies of cloud media.
services/cloud_cache.py
Cloud adapters
- Cloudinary adapter
services/cloudinary_service.py - Google Drive adapter
services/drive_service.py - Firebase adapter
services/firebase_service.py - Admin upload · Separates cloud upload work from the player application.
admin_upload.py
Connections 29
- Application bootstrap → Configuration: loads
- Application bootstrap → Database: initializes
- Application bootstrap → Playback manager: starts
- Application bootstrap → Views: launches
- Configuration → Database: configures
- Configuration → Stream cache: configures
- Configuration → Cloud cache: configures
- Configuration → Cloudinary adapter: configures
- Configuration → Google Drive adapter: configures
- Configuration → Firebase adapter: configures
- Views → UI components: composes
- UI styles → Views: styles
- Views → Playback manager: user commands
- Playback manager → Player: controls playback
- Playback manager → Stream cache: acquires media
- Playback manager → Cloud cache: acquires media
- Stream cache → Player: streamable media
- Cloud cache → Player: local media
- Stream cache → Cloudinary adapter: fetches media
- Cloud cache → Google Drive adapter: fetches media
- Player → Recent history: play events
- Player → Listening statistics: play events
- Recent history → Database: persists
- Listening statistics → Database: persists
- Database → Storage paths: uses storage layout
- Recent history → Views: history updates
- Listening statistics → Views: metric updates
- Admin upload → Cloudinary adapter: uploads media
- Admin upload → Google Drive adapter: uploads files