Skip to content

Commit

Permalink
add: My wave
Browse files Browse the repository at this point in the history
  • Loading branch information
levovix0 committed Feb 18, 2023
1 parent 35f0bfc commit fb82b9a
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 20 deletions.
2 changes: 2 additions & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
<file>resources/covers/favorite-ru.svg</file>
<file>resources/covers/downloads.svg</file>
<file>resources/covers/downloads-ru.svg</file>
<file>resources/covers/my wave.svg</file>
<file>resources/covers/my wave-ru.svg</file>

<!-- resources/placeholders -->
<file>resources/placeholders/playlist.svg</file>
Expand Down
23 changes: 23 additions & 0 deletions resources/covers/my wave-ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions resources/covers/my wave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,17 @@ proc liked*(playlist: Playlist): Future[seq[bool]] {.async.} =
proc toRadio*(track: Track): Future[Radio] {.async.} =
case track.kind
of yandex:
return Radio(kind: yandex, yandex: track.yandex.getRadioStation.toRadio.await)
return Radio(kind: yandex, yandex: yandexMusic.toRadio(track.yandex.getRadioStation).await)
of yandexFromFile:
return Radio(kind: yandex, yandex: track.yandexFromFile.id.getRadioStation.toRadio.await)
return Radio(kind: yandex, yandex: yandexMusic.toRadio(track.yandexFromFile.id.getRadioStation).await)
of yandexIdOnly:
return Radio(kind: yandex, yandex: track.yandexIdOnly.getRadioStation.toRadio.await)
return Radio(kind: yandex, yandex: yandexMusic.toRadio(track.yandexIdOnly.getRadioStation).await)
else:
raise ValueError.newException("can't convert this track to radio")

proc toRadio*(station: RadioStation): Future[Radio] {.async.} =
return Radio(kind: yandex, yandex: yandexMusic.toRadio(station).await)

proc next*(radio: Radio, totalPlayedSeconds: int) {.async.} =
case radio.kind
of yandex:
Expand Down
Loading

0 comments on commit fb82b9a

Please sign in to comment.