Added Etterna beatmap support

This commit is contained in:
Eduard Urbach 2018-03-13 16:45:40 +01:00
parent e9385ec079
commit b3257e78b6
5 changed files with 18 additions and 16 deletions

View File

@ -107,13 +107,6 @@ func sync(data *kitsu.Anime) *arn.Anime {
}
}
// NSFW
if attr.Nsfw {
anime.NSFW = 1
} else {
anime.NSFW = 0
}
// Rating
if anime.Rating == nil {
anime.Rating = &arn.AnimeRating{}

View File

@ -28,13 +28,18 @@ component SoundTrackPage(track *arn.SoundTrack, user *arn.User)
a.soundtrack-anime-list-item.ajax(href=anime.Link(), title=anime.Title.ByUser(user))
img.soundtrack-anime-list-item-image.lazy(data-src=anime.Image("small"), data-webp="true", alt=anime.Title.ByUser(user))
if len(track.Beatmaps()) > 0
//- TODO: This is quite ineffective, performance-wise
if len(track.OsuBeatmaps()) > 0 || len(track.EtternaBeatmaps()) > 0
.widget.mountable
h3.widget-title Beatmaps
ul.beatmaps
for index, beatmap := range track.Beatmaps()
for index, beatmap := range track.OsuBeatmaps()
li
a.beatmap(href="https://osu.ppy.sh/s/" + beatmap, target="_blank")= "Beatmap #" + strconv.Itoa(index + 1)
a.beatmap(href="https://osu.ppy.sh/s/" + beatmap, target="_blank")= "Osu Beatmap #" + strconv.Itoa(index + 1)
for index, beatmap := range track.EtternaBeatmaps()
li
a.beatmap(href="https://etternaonline.com/song/view/" + beatmap, target="_blank")= "Etterna Beatmap #" + strconv.Itoa(index + 1)
.widget.mountable
h3.widget-title Tags

View File

@ -11,7 +11,7 @@ func main() {
list := []*arn.Anime{}
for anime := range arn.StreamAnime() {
if anime.NSFW == 1 || anime.Status != "current" || anime.Type != "tv" || anime.StartDate == "" || anime.StartDate < "2017-12" || anime.StartDate > "2018-02-01" {
if anime.Status != "current" || anime.Type != "tv" || anime.StartDate == "" || anime.StartDate < "2017-12" || anime.StartDate > "2018-02-01" {
continue
}

View File

@ -45,16 +45,16 @@ let dark = {
// Toggle theme
export function toggleTheme(arn: AnimeNotifier) {
if(currentTheme === "light") {
darkTheme()
darkTheme(arn)
arn.statusMessage.showInfo("Previewing Dark theme. If you would like to use it permanently, please buy a PRO account.", 4000)
return
}
lightTheme()
lightTheme(arn)
}
// Light theme
export function lightTheme() {
export function lightTheme(arn: AnimeNotifier) {
let root = document.documentElement
for(let property in light) {
@ -69,9 +69,13 @@ export function lightTheme() {
}
// Dark theme
export function darkTheme() {
export function darkTheme(arn: AnimeNotifier) {
let root = document.documentElement
if(arn.user.dataset.pro !== "true") {
alert("You need a PRO account!")
}
for(let property in dark) {
if(!dark.hasOwnProperty(property)) {
continue

View File

@ -122,7 +122,7 @@ export class AnimeNotifier {
// Theme
if(this.user && this.user.dataset.pro === "true" && this.user.dataset.theme !== "light") {
darkTheme()
darkTheme(this)
}
// Status message