We fast now

This commit is contained in:
daru
2022-07-01 17:08:10 +02:00
parent cc525f2460
commit f078c93b9e
5 changed files with 12 additions and 36 deletions

View File

@@ -320,7 +320,8 @@ type MmOracle struct {
type MovieChart struct {
MmId int `json:"mmId"`
Anime int64 `json:"anime"`
Title string `json:"title"`
AvgScore float64 `json:"avgScore"`
UserCount int `json:"userCount"`
Data Anime `json:"data"`
}

View File

@@ -194,27 +194,6 @@ func LangeArbeit() {
}
}
charts, err := BuildMovieCharts()
if err != nil {
color.Errorln(err.Error())
logOut.WriteError(err)
} else {
for _, c := range charts {
// search season first
_, err = SearchSeason(c.Data.Anime)
if err == nil {
continue
}
err = refreshAnime(c.Data.Anime)
if err != nil {
color.Errorln(err.Error())
logOut.WriteError(err)
continue
}
count++
}
}
color.Infof("%d Anime aktualisiert\n", count)
logOut.WriteLine(fmt.Sprintf("🔃 %d Anime aktualisiert", count))
}

View File

@@ -295,18 +295,14 @@ func BuildMovieCharts() ([]MovieChart, error) {
charts = make([]MovieChart, 0)
for _, m := range movieList {
c := MovieChart{
MmId: m.Id,
}
anime, err := SearchAnime(m.Anime)
if err != nil {
color.Errorln(err.Error())
continue
MmId: m.Id,
Anime: m.Anime,
Title: m.Title,
}
c.Data = *anime
scoreSum := 0
for _, u := range users {
progress, _, score, err := FetchProgressOnState(anime.Anime, u.Username, malApiStatusC)
progress, _, score, err := FetchProgressOnState(c.Anime, u.Username, malApiStatusC)
if err != nil {
color.Errorln(err.Error())
continue

View File

@@ -55,10 +55,10 @@ body { background-color: #1a1a1a; color: #fff; }
{% for _, chart := range charts %}
<tr>
<td><a href="https://movies.hanami.family/movie/{%d chart.MmId %}" target="_blank" rel="noopener noreferrer">{%d chart.MmId %}</a></td>
<td><a href="{%s chart.Data.URL %}" target="_blank" rel="noopener noreferrer">{%dl chart.Data.Anime %}</a></td>
<td><a href="https://myanimelist.net/anime/{%dl chart.Anime %}" target="_blank" rel="noopener noreferrer">{%dl chart.Anime %}</a></td>
<td>{%d chart.UserCount %}</td>
<td><strong>{%f.2 chart.AvgScore %}</strong></td>
<td><strong>{%s chart.Data.Title %}</strong></td>
<td><strong>{%s chart.Title %}</strong></td>
</tr>
{% endfor %}
</table>

View File

@@ -67,13 +67,13 @@ func StreamIndex(qw422016 *qt422016.Writer, animes []Anime, oracles []MmOracle,
//line season.qtpl:57
qw422016.N().D(chart.MmId)
//line season.qtpl:57
qw422016.N().S(`</a></td> <td><a href="`)
qw422016.N().S(`</a></td> <td><a href="https://myanimelist.net/anime/`)
//line season.qtpl:58
qw422016.E().S(chart.Data.URL)
qw422016.N().DL(chart.Anime)
//line season.qtpl:58
qw422016.N().S(`" target="_blank" rel="noopener noreferrer">`)
//line season.qtpl:58
qw422016.N().DL(chart.Data.Anime)
qw422016.N().DL(chart.Anime)
//line season.qtpl:58
qw422016.N().S(`</a></td> <td>`)
//line season.qtpl:59
@@ -85,7 +85,7 @@ func StreamIndex(qw422016 *qt422016.Writer, animes []Anime, oracles []MmOracle,
//line season.qtpl:60
qw422016.N().S(`</strong></td> <td><strong>`)
//line season.qtpl:61
qw422016.E().S(chart.Data.Title)
qw422016.E().S(chart.Title)
//line season.qtpl:61
qw422016.N().S(`</strong></td> </tr> `)
//line season.qtpl:63