2018-04-13 11:09:46 +00:00
|
|
|
package filtersoundtracks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aerogo/aero"
|
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 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 ""
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|