Add accordion and fix minor issues (#742)
* Add docs v0.0.1 * Add icon size warning * Fix sourcenover caution * Fix semver descriptions * Filters fix * Quickfix quickstart * Add icon warning v2 * Fix typos * Add NovelItem * Update plugins host * Update plugins host * Remove unnecesarry .js and .dist * Update plugins host * Add host.ps1 * Fix readme.txt * Fix READNE.txt, again * Remove .js and .dist * Add accordion * Working pagination * readme update with ost * Add linux/windows hosting functions * Add tswatch * Fix fetch function * Change plugin versions * Fix chrome * Fix workflows * Fix search not showing results * remove unnecesarry code * Revert novelupdates changes * Reverted NobleMTL instead of novelupdates, fixing that * Revert nobleMTL to e346c7d0 * WTF NobleMTL?
This commit is contained in:
+11
-6
@@ -6,7 +6,7 @@ import { Plugin, isPlugin } from "@typings/plugin";
|
||||
import { Filters } from "@libs/filterInputs";
|
||||
const root = path.dirname(require?.main?.filename || "");
|
||||
|
||||
export const fetchHeaders: Record<string, string> = {}
|
||||
export const fetchHeaders: Record<string, string> = {};
|
||||
|
||||
export const all_plugins = (): PluginList => {
|
||||
const res: PluginList = {};
|
||||
@@ -48,9 +48,12 @@ const getPlugin = async (
|
||||
): Promise<Plugin.PluginBase | null> => {
|
||||
console.log("loading plugin", requirePath);
|
||||
const plugin = await require(requirePath).default;
|
||||
console.log(plugin);
|
||||
if (isPlugin(plugin)) return plugin;
|
||||
console.log("Not a plugin!");
|
||||
// console.log(plugin);
|
||||
if (isPlugin(plugin)) {
|
||||
console.log("loaded plugin", plugin.name);
|
||||
return plugin;
|
||||
}
|
||||
console.error("Not a plugin!");
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -59,13 +62,15 @@ export const getFilter = async (pluginRequirePath: string) =>
|
||||
|
||||
export const popularNovels = async (
|
||||
pluginRequirePath: string,
|
||||
page: number,
|
||||
options: Plugin.PopularNovelsOptions<Filters>
|
||||
) => (await getPlugin(pluginRequirePath))?.popularNovels(1, options);
|
||||
) => (await getPlugin(pluginRequirePath))?.popularNovels(page, options);
|
||||
|
||||
export const searchNovels = async (
|
||||
pluginRequirePath: string,
|
||||
page: number,
|
||||
searchTerm: string
|
||||
) => (await getPlugin(pluginRequirePath))?.searchNovels(searchTerm, 1);
|
||||
) => (await getPlugin(pluginRequirePath))?.searchNovels(searchTerm, page);
|
||||
|
||||
export const parseNovelAndChapters = async (
|
||||
pluginRequirePath: string,
|
||||
|
||||
Reference in New Issue
Block a user