diff --git a/src/scripts/fetch-latest.ts b/src/scripts/fetch-data/fetch-latest.ts similarity index 73% rename from src/scripts/fetch-latest.ts rename to src/scripts/fetch-data/fetch-latest.ts index 651e254..501aa4c 100644 --- a/src/scripts/fetch-latest.ts +++ b/src/scripts/fetch-data/fetch-latest.ts @@ -1,20 +1,20 @@ "use strict"; // Modules from file -import { fetchGETResponse } from "./network-helper.js"; -import LatestSearchQuery from "./classes/latest-search-query.js"; -import { urls as f95url } from "./constants/url.js"; +import { fetchGETResponse } from "../network-helper.js"; +import LatestSearchQuery from "../classes/query/latest-search-query.js"; +import { urls as f95url } from "../constants/url.js"; /** - * Gets the URLs of the latest updated games that match the passed parameters. + * Gets the URLs of the latest handiworks that match the passed parameters. * You *must* be logged. * @param {LatestSearchQuery} query * Query used for the search * @param {Number} limit * Maximum number of items to get. Default: 30 - * @returns {Promise} URLs of the fetched games + * @returns {Promise} URLs of the handiworks */ -export async function fetchLatest(query: LatestSearchQuery, limit = 30): Promise { +export default async function fetchLatestHandiworkURLs(query: LatestSearchQuery, limit = 30): Promise { // Local variables const threadURL = new URL("threads/", f95url.F95_BASE_URL).href; const resultURLs = []; diff --git a/src/scripts/fetch-platform-data.ts b/src/scripts/fetch-data/fetch-platform-data.ts similarity index 92% rename from src/scripts/fetch-platform-data.ts rename to src/scripts/fetch-data/fetch-platform-data.ts index 7f4f3ba..6daaffa 100644 --- a/src/scripts/fetch-platform-data.ts +++ b/src/scripts/fetch-data/fetch-platform-data.ts @@ -7,10 +7,10 @@ import { readFileSync, writeFileSync, existsSync } from "fs"; import cheerio from "cheerio"; // Modules from file -import shared, { TPrefixDict } from "./shared.js"; -import { urls as f95url } from "./constants/url.js"; -import { selectors as f95selector} from "./constants/css-selector.js"; -import { fetchHTML } from "./network-helper.js"; +import shared, { TPrefixDict } from "../shared.js"; +import { urls as f95url } from "../constants/url.js"; +import { selectors as f95selector} from "../constants/css-selector.js"; +import { fetchHTML } from "../network-helper.js"; //#region Interface definitions /** @@ -46,7 +46,7 @@ interface ILatestResource { * Gets the basic data used for game data processing * (such as graphics engines and progress statuses) */ -export async function fetchPlatformData(): Promise { +export default async function fetchPlatformData(): Promise { // Check if the data are cached if (!readCache(shared.cachePath)) { // Load the HTML