odmobile

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package odmobile is the OpenDeezer engine exposed for gomobile (gobind), so a native Android (or iOS) app can drive the same login/decrypt/decode/playback pipeline the desktop GUIs use. Build it with:

gomobile bind -target=android -androidapi 24 -o gui/android/app/libs/odmobile.aar ./mobile

Every browse/list call returns a JSON string (the wire shape the GUIs already use); mutations return bool/string. The caller polls FinishedCount to drive auto-advance, mirroring the C-archive frontends.

Index

Constants

View Source
const Version = "1.5.2"

Version is the engine/app version.

Variables

This section is empty.

Functions

func Account

func Account() string

func AddFavorite

func AddFavorite(id string) bool

func AddToPlaylist

func AddToPlaylist(playlistID, trackID string) bool

func AlbumTracks

func AlbumTracks(id string) string

func ArtistProfile

func ArtistProfile(id string) string

func ArtistTop

func ArtistTop(id string) string

func Charts

func Charts() string

func CheckUpdate added in v1.5.1

func CheckUpdate() string

CheckUpdate checks GitHub for a newer release; returns JSON {current, latest, hasUpdate, url, notes}.

func ConnectDevice

func ConnectDevice(addr string) bool

ConnectDevice routes playback to the device at addr (host:port). Stops local playback (audio moves to the device). Returns true on success.

func ConnectHostInfo added in v1.5.1

func ConnectHostInfo() string

ConnectHostInfo returns a JSON string: {"enabled":bool,"addr":"<lanip>:<port>","port":<int>,"name":"<account>"}. addr/name are empty when the Connect host is disabled.

func ConnectHostSetEnabled added in v1.5.1

func ConnectHostSetEnabled(on int)

ConnectHostSetEnabled makes this device a discoverable OpenDeezer Connect target on the LAN (on!=0), so other devices signed into the same Deezer account can find it in their device picker and drive its playback; or stops advertising it (on==0). The control server runs on a LAN address with same-account auth. Idempotent.

func ConnectedDevice

func ConnectedDevice() string

ConnectedDevice returns the connected device address ("" if local).

func CreatePlaylist

func CreatePlaylist(title string) string

func CrossfadeMS

func CrossfadeMS() int

func DeletePlaylist

func DeletePlaylist(id string) bool

func DisconnectDevice

func DisconnectDevice()

DisconnectDevice returns control to local playback. Stops the remote device (so it doesn't keep playing unattended) before clearing the connection.

func DiscoverDevices

func DiscoverDevices(timeoutMS int) string

DiscoverDevices returns LAN + configured Connect devices as a JSON array.

func DurationMS

func DurationMS() int64

func Favorites

func Favorites() string

func Fetch

func Fetch(url string) []byte

Fetch downloads raw bytes (e.g. cover art) using a browser User-Agent.

func FinishedCount

func FinishedCount() int

func Flow

func Flow() string

func Format

func Format() string

func Gapless

func Gapless() bool

func Home added in v1.5.0

func Home() string

Home aggregates the Home-screen sections (charts top tracks/albums + the user's playlists) in one call, mirroring corelib DZHomeJSON. Best-effort.

func Init

func Init(arl string) bool

Init logs in with the ARL and starts the engine. Returns true on success.

func LoggedIn

func LoggedIn() bool

LoggedIn reports whether Init succeeded.

func Lyrics

func Lyrics(id string) string

func NowPlaying

func NowPlaying() string

NowPlaying returns the track actually playing (remote when routed, else local).

func Pause

func Pause()

func Play

func Play(trackID string, durationMS int64) bool

Play resolves + plays a track. When routed to a Connect device, it plays there.

func PlayEpisode

func PlayEpisode(id string) bool

PlayEpisode resolves + plays a podcast episode (plain stream). Sets the episode as the current track immediately (id only), then asynchronously enriches title / podcast name / artwork via the REST /episode endpoint.

func PlaylistTracks

func PlaylistTracks(id string) string

func Playlists

func Playlists() string

func PodcastEpisodes

func PodcastEpisodes(id string) string

func PositionMS

func PositionMS() int64

func Quality

func Quality() int

func RemoveFavorite

func RemoveFavorite(id string) bool

func RemoveFromPlaylist

func RemoveFromPlaylist(playlistID, trackID string) bool

func RenamePlaylist

func RenamePlaylist(id, title string) bool

func ReplayGain

func ReplayGain() bool

func Resume

func Resume()
func Search(q string) string

func SearchPodcasts

func SearchPodcasts(q string) string

func Seek

func Seek(ms int64)

func SetClientInfo

func SetClientInfo(clientName, device string)

SetClientInfo overrides the advertised client id + device label (before Init).

func SetCrossfadeMS

func SetCrossfadeMS(ms int)

func SetGapless

func SetGapless(on bool)

func SetQuality

func SetQuality(level int)

func SetRepeat added in v1.0.1

func SetRepeat(mode int)

SetRepeat sets the repeat mode on the connected remote device (mode: 0=off, 1=all, 2=one). No-op when playing locally — GUIs own their queue.

func SetReplayGain

func SetReplayGain(on bool)

func SetShuffle added in v1.0.1

func SetShuffle(on int)

SetShuffle sets shuffle on (non-zero) or off (0) on the connected remote device. No-op when playing locally — GUIs own their queue.

func SetVolume

func SetVolume(v float64)

func State

func State() int

func Stop

func Stop()

func TogglePause

func TogglePause()

func UserID

func UserID() string

func Volume

func Volume() float64

func WebRemoteInfo added in v1.0.1

func WebRemoteInfo() string

WebRemoteInfo returns a JSON string: {"enabled":bool,"code":"123456","url":"http://<lanip>:<port>/remote","port":<int>}. code and url are empty when the remote is disabled.

func WebRemoteQRPNG added in v1.0.1

func WebRemoteQRPNG() []byte

WebRemoteQRPNG returns a PNG-encoded QR code for the web remote URL, or nil when the remote is disabled. Free-able by the caller (Go GC manages it).

func WebRemoteSetEnabled added in v1.0.1

func WebRemoteSetEnabled(on int)

WebRemoteSetEnabled enables (on!=0) or disables (on==0) the web remote. When enabling, the control server is started on a LAN-reachable address if it is not already, and pairing is activated so a phone can scan the QR and connect.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL