Skip to content

Feature: Tidal Integration Support #28

@oca-agent

Description

@oca-agent

Plan: Tidal Integration for SMoC

1. Product Requirements

Background & Relevance

Tidal is the premier service for high-fidelity audio. SMoC users who value terminal minimalist UI often overlap with audiophiles who appreciate Tidal's FLAC and Master quality streams. Supporting Tidal positions SMoC as a "Hi-Fi CLI Player."

Feature Scope

  • High-Quality Playback: Support for AAC and Lossless FLAC streams.
  • Device Authentication: Implementation of the "Device Code" OAuth flow (best for terminal apps without a browser).
  • Library Management: Access to user's "My Collection" (Artists, Albums, Playlists).

2. Technical Implementation Plan

Architecture Overview

Tidal uses a complex OAuth-based authentication system. The TidalStreamingClient will need to handle persistent tokens and refresh cycles.

Proposed Code Changes

1. Configuration (Smoc.Configuration)

  • Create TidalConfig.cs:
    • ClientId / ClientSecret: Required for OAuth.
    • AccessToken / RefreshToken: Stored securely to avoid re-auth.
    • QualitySetting: (Low, High, Lossless).

2. Streaming Client (Smoc.Streaming.Tidal)

  • TidalStreamingClient.cs:
    • Implement IStreamingClient.
    • Authentication: Implement the device/authorization flow.
    • Metadata: Use Tidal's /tracks, /albums, and /artists endpoints.
    • Playback: Call the /playbackinfo endpoint to receive the stream manifest. Tidal provides streams in encrypted/protected formats, but standard AAC/FLAC URLs are available for standard API clients.

Libraries & Dependencies

  • System.Net.Http: For REST API calls.
  • Newtonsoft.Json or System.Text.Json: For complex manifest parsing.

Implementation Milestones

  1. OAuth Handshake: Implement the terminal-based "Go to this URL and enter code" flow.
  2. Catalog Browsing: Map Tidal's rich metadata to SMoC entities.
  3. Lossless Streaming: Ensure SoundFlow is configured to handle FLAC streams from Tidal.
  4. Listen History: Implement scrobbling to Tidal's history service.

3. Future Considerations

  • MQA Support: (Low priority) Handling Master Quality Authenticated streams if required.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions