27 lines
546 B
Go
Raw Normal View History

2018-04-13 11:09:46 +00:00
package filtersoundtracks
import (
"github.com/aerogo/aero"
2019-06-03 09:32:43 +00:00
"github.com/animenotifier/notify.moe/arn"
2018-04-13 11:09:46 +00:00
)
// Links shows soundtracks without links.
2019-06-01 04:55:49 +00:00
func Links(ctx aero.Context) error {
2018-04-13 11:09:46 +00:00
return editorList(
ctx,
"Soundtracks without links",
func(track *arn.SoundTrack) bool {
return len(track.Links) == 0
},
func(track *arn.SoundTrack) string {
youtubeMedia := track.MediaByService("Youtube")
if len(youtubeMedia) > 0 {
return "https://song.link/https://youtu.be/" + youtubeMedia[0].ServiceID
}
return ""
},
)
}