sources/lfm

Source   Edit  

Types

Attributes = object
  nowplaying*: string
Source   Edit  
FMDate = object
  uts*, text*: string
Source   Edit  
FMTrack = object
  artist*, album*: JsonNode
  date*: Option[FMDate]
  mbid*, name*, url*: Option[string]
  `@ attr`*: Option[Attributes]
Source   Edit  
Scrobble = object
  track*, artist*: string
  album*, mbid*, albumArtist*: Option[string]
  timestamp*, trackNumber*, duration*: Option[int]
Source   Edit  

Consts

apiKey = "f6cbd0de2ace1b377de4ed27f73af158"
Source   Edit  
apiSecret = "6a037eaccb1957d1b63354b02a4eeb62"
Source   Edit  
userBaseUrl: cstring = "https://last.fm/user/"
Source   Edit  

Procs

func `==`(a, b: Attributes): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
func `==`(a, b: FMDate): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
func `==`(a, b: FMTrack): bool {....raises: [Exception], tags: [RootEffect],
                                 forbids: [].}
Source   Edit  
func `==`(a, b: Scrobble): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc initUser(fm: AsyncLastFM; username: cstring; sessionKey: cstring = ""): Future[
    User] {....stackTrace: false, raises: [Exception],
            tags: [TimeEffect, RootEffect, ReadIOEffect, WriteIOEffect],
            forbids: [].}
Gets a given Last.fm user's now playing, recent tracks, and latest listen timestamp. Returns a User object Source   Edit  
proc pageUser(fm: AsyncLastFM; user: var User; endInd: var int; inc: int = 10): owned(
    Future[void]) {....stackTrace: false, raises: [Exception], tags: [RootEffect,
    TimeEffect, ReadIOEffect, WriteIOEffect], forbids: [].}
Backfills Last.fm user's recent tracks Source   Edit  
proc submitMirrorQueue(fm: AsyncLastFM; user: var User): owned(Future[void]) {.
    ...stackTrace: false, raises: [Exception],
    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect], forbids: [].}
Submits Last.fm user's now playing and listen history that are not mirrored or preMirror Source   Edit  
proc updateUser(fm: AsyncLastFM; user: User; resetLastUpdate, preMirror = false): Future[
    User] {....stackTrace: false, raises: [Exception],
            tags: [TimeEffect, RootEffect, ReadIOEffect, WriteIOEffect],
            forbids: [].}
Updates Last.fm user's now playing, recent tracks, and latest listen timestamp Source   Edit