Skip to content

Commit

Permalink
Update macos icon, update deps, fix episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Layendan committed Jun 2, 2024
1 parent 15d356a commit 8ceadc1
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 100 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@types/culori": "^2.1.0",
"@types/node": "^20.12.12",
"@types/nprogress": "^0.2.3",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"autoprefixer": "^10.4.19",
"daisyui": "^4.11.1",
"eslint": "^9.3.0",
Expand All @@ -56,7 +56,7 @@
"dependencies": {
"@consumet/extensions": "^1.6.0",
"@tauri-apps/api": "^1.5.6",
"axios-tauri-api-adapter": "https://github.com/Layendan/axios-tauri-api-adapter",
"axios-tauri-api-adapter": "0.2.1",
"culori": "^4.0.1",
"hls.js": "^1.5.8",
"isomorphic-dompurify": "^2.11.0",
Expand Down
45 changes: 45 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ discord-rich-presence = "0.2.3"
lazy_static = "1.4.0"
log = "0.4.20"
os_info = "3.7.0"
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }

[features]
# by default Tauri runs in production mode
Expand Down
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
2 changes: 2 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ struct SInst {
}

fn main() {
let _ = fix_path_env::fix();

tauri_plugin_deep_link::prepare("com.layendan.dev");
tauri::Builder::default()
.setup(|app| {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Layendanimator",
"version": "0.1.57"
"version": "0.1.58"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.macos.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Layendanimator",
"version": "0.1.57"
"version": "0.1.58"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Layendanimator",
"version": "0.1.57"
"version": "0.1.58"
},
"tauri": {
"allowlist": {
Expand Down
78 changes: 39 additions & 39 deletions src/lib/model/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function fetchTrendingAnime(
if (provider) {
const metaProvider = new META.Anilist(provider);
const trendingRes = (
await metaProvider.fetchTrendingAnime(page, perPage)
await metaProvider.fetchTrendingAnime(page, perPage ?? 25)
).results.map(anime => ({
id: anime.id,
title: anime.title,
Expand Down Expand Up @@ -174,7 +174,7 @@ export async function fetchPopularAnime(
if (provider) {
const metaProvider = new META.Anilist(provider);
const popularRes = (
await metaProvider.fetchPopularAnime(page, perPage)
await metaProvider.fetchPopularAnime(page, perPage ?? 25)
).results.map(anime => ({
id: anime.id,
title: anime.title,
Expand Down Expand Up @@ -466,43 +466,43 @@ export async function fetchEpisode(id: string, source: Anime['source']) {
if (!userSource?.scripts?.fetchEpisodes)
error(500, 'Source script not found');

let provider;

const { axiosTauriApiAdapter } = await import('axios-tauri-api-adapter');
switch (source.id) {
case 'gogoanime':
provider = new ANIME.Gogoanime(
undefined,
undefined,
axiosTauriApiAdapter
);
break;
case 'zoro':
provider = new ANIME.Zoro();
break;
}

if (provider) {
// provider.setProxy({ url: 'https://corsproxy.io/?' });
const metaProvider = new META.Anilist(provider);

metaProvider.setAxiosAdapter(axiosTauriApiAdapter);
provider.setAxiosAdapter(axiosTauriApiAdapter);

const res = (await metaProvider.fetchEpisodeSources(id)) as EpisodeData;

if (res) {
episodeCache.set(`${source.id}/${id}`, res);
return res;
} else {
notifications.addNotification({
title: 'Episode could not be found',
message: `The episode with id ${id} was not found.`,
type: 'error'
});
error(404, 'Episode not found');
}
}
// let provider;

// const { axiosTauriApiAdapter } = await import('axios-tauri-api-adapter');
// switch (source.id) {
// case 'gogoanime':
// provider = new ANIME.Gogoanime(
// undefined,
// undefined,
// axiosTauriApiAdapter
// );
// break;
// case 'zoro':
// provider = new ANIME.Zoro();
// break;
// }

// if (provider) {
// // provider.setProxy({ url: 'https://corsproxy.io/?' });
// const metaProvider = new META.Anilist(provider);

// metaProvider.setAxiosAdapter(axiosTauriApiAdapter);
// provider.setAxiosAdapter(axiosTauriApiAdapter);

// const res = (await metaProvider.fetchEpisodeSources(id)) as EpisodeData;

// if (res) {
// episodeCache.set(`${source.id}/${id}`, res);
// return res;
// } else {
// notifications.addNotification({
// title: 'Episode could not be found',
// message: `The episode with id ${id} was not found.`,
// type: 'error'
// });
// error(404, 'Episode not found');
// }
// }

const episode = await safeEval<EpisodeData>(
userSource.scripts.fetchEpisodes,
Expand Down
Loading

0 comments on commit 8ceadc1

Please sign in to comment.