2024-03-18 10:34:43 +00:00
|
|
|
package music
|
|
|
|
|
2024-03-18 20:19:04 +00:00
|
|
|
import (
|
2024-03-23 18:02:11 +00:00
|
|
|
"fmt"
|
|
|
|
"time"
|
2024-03-18 20:19:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func make_date_work(date string) time.Time {
|
2024-03-23 18:02:11 +00:00
|
|
|
res, err := time.Parse("2-Jan-2006", date)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("somehow we failed to parse %s! falling back to epoch :]\n", date)
|
|
|
|
return time.Unix(0, 0)
|
|
|
|
}
|
|
|
|
return res
|
2024-03-18 20:19:04 +00:00
|
|
|
}
|
|
|
|
|
2024-03-21 05:19:18 +00:00
|
|
|
func GetRelease(id string) (MusicRelease, bool) {
|
2024-03-23 18:02:11 +00:00
|
|
|
for _, album := range placeholders {
|
|
|
|
if album.Id == id {
|
|
|
|
return album, true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return MusicRelease{}, false
|
2024-03-18 10:34:43 +00:00
|
|
|
}
|
|
|
|
|
2024-03-21 05:19:18 +00:00
|
|
|
func QueryAllMusic() ([]MusicRelease) {
|
2024-03-23 18:02:11 +00:00
|
|
|
return placeholders
|
2024-03-18 10:34:43 +00:00
|
|
|
}
|
|
|
|
|
2024-03-18 20:19:04 +00:00
|
|
|
func QueryAllArtists() ([]Artist) {
|
2024-03-23 18:02:11 +00:00
|
|
|
return []Artist{ ari, mellodoot, zaire, mae, loudar, red }
|
2024-03-18 20:19:04 +00:00
|
|
|
}
|
|
|
|
|