Skip to content
This repository was archived by the owner on Nov 20, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6e9d206

Browse files
committedJun 23, 2021
Add last updated section
1 parent 6d76b9f commit 6e9d206

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed
 

‎src/DankeFurs/DankeFurs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const BASE = "https://danke.moe"
55

66
export const DankeFursInfo: SourceInfo = {
77
icon: "icon.png",
8-
version: "1.1.0",
8+
version: "1.1.1",
99
name: "DankeFurs",
1010
author: "PythonCoderAS",
1111
authorWebsite: "https://github.com/PythonCoderAS",

‎src/GuyaTemplate.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ export abstract class GuyaTemplate extends Source {
149149
async getHomePageSections(sectionCallback: (section: HomeSection) => void): Promise<void> {
150150

151151
// Send the empty homesection back so the app can preload the section
152-
var homeSection = createHomeSection({ id: "all", title: "ALL MANGAS" })
152+
let homeSection = createHomeSection({ id: "all", title: "ALL MANGAS" })
153+
let homeSection2 = createHomeSection({id: "latest", title: "UPDATED RECENTLY"})
153154
sectionCallback(homeSection)
155+
sectionCallback(homeSection2)
154156

155157
const request = createRequestObject({
156158
url: `${this.baseUrl}/api/get_all_series/`,
@@ -159,7 +161,11 @@ export abstract class GuyaTemplate extends Source {
159161

160162
const data = await this.requestManager.schedule(request, 1)
161163

162-
let result = typeof data.data === "string" ? JSON.parse(data.data) : data.data
164+
let result: {[key: string]: {[name: string]: any}} = typeof data.data === "string" ? JSON.parse(data.data) : data.data
165+
let result2 = [...(Object.values(result))];
166+
result2.sort((a, b) => {
167+
return b["last_updated"] - a["last_updated"];
168+
})
163169

164170
let mangas = []
165171
for (let series in result) {
@@ -174,7 +180,21 @@ export abstract class GuyaTemplate extends Source {
174180
}
175181
homeSection.items = mangas
176182

177-
sectionCallback(homeSection)
183+
let mangas2 = []
184+
for (let series in result2) {
185+
let seriesDetails = result2[series]
186+
mangas2.push(
187+
createMangaTile({
188+
id: seriesDetails["slug"],
189+
image: `${this.baseUrl}/${seriesDetails["cover"]}`,
190+
title: createIconText({ text: series }),
191+
})
192+
)
193+
}
194+
homeSection2.items = mangas2;
195+
196+
sectionCallback(homeSection);
197+
sectionCallback(homeSection2);
178198
}
179199

180200
async filterUpdatedManga(mangaUpdatesFoundCallback: (updates: MangaUpdates) => void, time: Date, ids: string[]): Promise<void> {

‎src/Hachirumi/Hachirumi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const BASE = "https://hachirumi.com"
55

66
export const HachirumiInfo: SourceInfo = {
77
icon: "icon.png",
8-
version: "1.0.0",
8+
version: "1.0.1",
99
name: "Hachirumi",
1010
author: "PythonCoderAS",
1111
authorWebsite: "https://github.com/PythonCoderAS",

‎src/MahouShoujoBu/MahouShoujoBu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const BASE = "https://mahoushoujobu.com"
55

66
export const MahouShoujoBuInfo: SourceInfo = {
77
icon: "icon.png",
8-
version: "1.0.3",
8+
version: "1.0.4",
99
name: "MahouShoujoBu",
1010
author: "PythonCoderAS",
1111
authorWebsite: "https://github.com/PythonCoderAS",

0 commit comments

Comments
 (0)
This repository has been archived.