module CrystalGauntlet::Songs

Extended Modules

Defined in:

lib/songs.cr

Constant Summary

CUSTOM_SONG_START = 50
GD_AUDIO_FORMAT = "mp3"
REUPLOADED_SONG_ADD_ID = 5000000

todo: make this configurable

UNKNOWN_SONG_AUTHOR = 1

set in 6_songs.sql

Instance Method Summary

Instance Method Detail

def fetch_song(song_id : Int32, get_download = false) : Tuple(String, Int32, String, Int32 | Nil, String | Nil) | Nil #

name, author id, author name, size, download url returns nil if song should be disabled throws if something failed todo: why is size sometimes 0.00 despite the song being downloaded?


[View source]
def fetch_song_metadata(url : String) : SongMetadata #

will raise errors


[View source]
def get_artist_id(artist_name : String, artist_url : String, source : String) : Int32 #

[View source]
def get_file_path(song_id : Int32) #

[View source]
def is_custom_song(id) #

[View source]
def is_reuploaded_song(id) #

[View source]
def is_source_allowed(source : String) : Bool #

[View source]