mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-14 18:39:53 +01:00
We fast now
This commit is contained in:
3
klotz.go
3
klotz.go
@@ -320,7 +320,8 @@ type MmOracle struct {
|
|||||||
|
|
||||||
type MovieChart struct {
|
type MovieChart struct {
|
||||||
MmId int `json:"mmId"`
|
MmId int `json:"mmId"`
|
||||||
|
Anime int64 `json:"anime"`
|
||||||
|
Title string `json:"title"`
|
||||||
AvgScore float64 `json:"avgScore"`
|
AvgScore float64 `json:"avgScore"`
|
||||||
UserCount int `json:"userCount"`
|
UserCount int `json:"userCount"`
|
||||||
Data Anime `json:"data"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
color.Infof("%d Anime aktualisiert\n", count)
|
||||||
logOut.WriteLine(fmt.Sprintf("🔃 %d Anime aktualisiert", count))
|
logOut.WriteLine(fmt.Sprintf("🔃 %d Anime aktualisiert", count))
|
||||||
}
|
}
|
||||||
|
|||||||
12
schaffer.go
12
schaffer.go
@@ -295,18 +295,14 @@ func BuildMovieCharts() ([]MovieChart, error) {
|
|||||||
charts = make([]MovieChart, 0)
|
charts = make([]MovieChart, 0)
|
||||||
for _, m := range movieList {
|
for _, m := range movieList {
|
||||||
c := MovieChart{
|
c := MovieChart{
|
||||||
MmId: m.Id,
|
MmId: m.Id,
|
||||||
}
|
Anime: m.Anime,
|
||||||
anime, err := SearchAnime(m.Anime)
|
Title: m.Title,
|
||||||
if err != nil {
|
|
||||||
color.Errorln(err.Error())
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Data = *anime
|
|
||||||
scoreSum := 0
|
scoreSum := 0
|
||||||
for _, u := range users {
|
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 {
|
if err != nil {
|
||||||
color.Errorln(err.Error())
|
color.Errorln(err.Error())
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ body { background-color: #1a1a1a; color: #fff; }
|
|||||||
{% for _, chart := range charts %}
|
{% for _, chart := range charts %}
|
||||||
<tr>
|
<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="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>{%d chart.UserCount %}</td>
|
||||||
<td><strong>{%f.2 chart.AvgScore %}</strong></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>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ func StreamIndex(qw422016 *qt422016.Writer, animes []Anime, oracles []MmOracle,
|
|||||||
//line season.qtpl:57
|
//line season.qtpl:57
|
||||||
qw422016.N().D(chart.MmId)
|
qw422016.N().D(chart.MmId)
|
||||||
//line season.qtpl:57
|
//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
|
//line season.qtpl:58
|
||||||
qw422016.E().S(chart.Data.URL)
|
qw422016.N().DL(chart.Anime)
|
||||||
//line season.qtpl:58
|
//line season.qtpl:58
|
||||||
qw422016.N().S(`" target="_blank" rel="noopener noreferrer">`)
|
qw422016.N().S(`" target="_blank" rel="noopener noreferrer">`)
|
||||||
//line season.qtpl:58
|
//line season.qtpl:58
|
||||||
qw422016.N().DL(chart.Data.Anime)
|
qw422016.N().DL(chart.Anime)
|
||||||
//line season.qtpl:58
|
//line season.qtpl:58
|
||||||
qw422016.N().S(`</a></td> <td>`)
|
qw422016.N().S(`</a></td> <td>`)
|
||||||
//line season.qtpl:59
|
//line season.qtpl:59
|
||||||
@@ -85,7 +85,7 @@ func StreamIndex(qw422016 *qt422016.Writer, animes []Anime, oracles []MmOracle,
|
|||||||
//line season.qtpl:60
|
//line season.qtpl:60
|
||||||
qw422016.N().S(`</strong></td> <td><strong>`)
|
qw422016.N().S(`</strong></td> <td><strong>`)
|
||||||
//line season.qtpl:61
|
//line season.qtpl:61
|
||||||
qw422016.E().S(chart.Data.Title)
|
qw422016.E().S(chart.Title)
|
||||||
//line season.qtpl:61
|
//line season.qtpl:61
|
||||||
qw422016.N().S(`</strong></td> </tr> `)
|
qw422016.N().S(`</strong></td> </tr> `)
|
||||||
//line season.qtpl:63
|
//line season.qtpl:63
|
||||||
|
|||||||
Reference in New Issue
Block a user