Refactor
This commit is contained in:
parent
46a3715bae
commit
7892657362
@ -34,7 +34,6 @@ var jobs = map[string]time.Duration{
|
|||||||
"twist": 2 * time.Hour,
|
"twist": 2 * time.Hour,
|
||||||
"search-index": 2 * time.Hour,
|
"search-index": 2 * time.Hour,
|
||||||
"refresh-episodes": 10 * time.Hour,
|
"refresh-episodes": 10 * time.Hour,
|
||||||
"refresh-track-titles": 10 * time.Hour,
|
|
||||||
"refresh-osu": 12 * time.Hour,
|
"refresh-osu": 12 * time.Hour,
|
||||||
"sync-anime": 12 * time.Hour,
|
"sync-anime": 12 * time.Hour,
|
||||||
"sync-shoboi": 24 * time.Hour,
|
"sync-shoboi": 24 * time.Hour,
|
||||||
|
@ -24,14 +24,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sync(track *arn.SoundTrack) {
|
func sync(track *arn.SoundTrack) {
|
||||||
for _, media := range track.Media {
|
// for _, media := range track.Media {
|
||||||
media.RefreshMetaData()
|
// media.RefreshMetaData()
|
||||||
println(media.Service, media.Title)
|
// println(media.Service, media.Title)
|
||||||
}
|
// }
|
||||||
|
|
||||||
err := track.Save()
|
// err := track.Save()
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,23 @@ func TestRoutes(t *testing.T) {
|
|||||||
func TestInterfaceImplementations(t *testing.T) {
|
func TestInterfaceImplementations(t *testing.T) {
|
||||||
// API interfaces
|
// API interfaces
|
||||||
var creatable = reflect.TypeOf((*api.Creatable)(nil)).Elem()
|
var creatable = reflect.TypeOf((*api.Creatable)(nil)).Elem()
|
||||||
var updatable = reflect.TypeOf((*api.Updatable)(nil)).Elem()
|
var editable = reflect.TypeOf((*api.Editable)(nil)).Elem()
|
||||||
var actionable = reflect.TypeOf((*api.Actionable)(nil)).Elem()
|
var actionable = reflect.TypeOf((*api.Actionable)(nil)).Elem()
|
||||||
var collection = reflect.TypeOf((*api.Collection)(nil)).Elem()
|
var collection = reflect.TypeOf((*api.Collection)(nil)).Elem()
|
||||||
|
|
||||||
// Required interface implementations
|
// Required interface implementations
|
||||||
var interfaceImplementations = map[string][]reflect.Type{
|
var interfaceImplementations = map[string][]reflect.Type{
|
||||||
"User": []reflect.Type{
|
"User": []reflect.Type{
|
||||||
updatable,
|
editable,
|
||||||
},
|
},
|
||||||
"Thread": []reflect.Type{
|
"Thread": []reflect.Type{
|
||||||
creatable,
|
creatable,
|
||||||
updatable,
|
editable,
|
||||||
actionable,
|
actionable,
|
||||||
},
|
},
|
||||||
"Post": []reflect.Type{
|
"Post": []reflect.Type{
|
||||||
creatable,
|
creatable,
|
||||||
updatable,
|
editable,
|
||||||
actionable,
|
actionable,
|
||||||
},
|
},
|
||||||
"SoundTrack": []reflect.Type{
|
"SoundTrack": []reflect.Type{
|
||||||
|
Loading…
Reference in New Issue
Block a user