miru-project / miru-app

🎉 A versatile application that is free, open-source, and supports extension sources for videos, comics, and novels, available on Android, Windows, and Web platforms.
https://miru.js.org
GNU Affero General Public License v3.0
4.16k stars 167 forks source link

Do not query TMDB when no API key configured #310

Open cweiske opened 4 days ago

cweiske commented 4 days ago

Describe your suggested feature

Miru always asks the TMDB API even when no API key is configured. In that case, TMDB returns a HTTP 401 status code.

This is especially annoying when developing an extension - every time an episode is opened, the log is spammed with those HTTP errors:

Miru SEVERE 2024-11-21 14:52:48.431719:  DioException [bad response]: This exception was thrown because the response has a status code of 401 and RequestOptions.validateStatus was configured to throw for this status code.
The status code of 401 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.
 #0      DioMixin.fetch (package:dio/src/dio_mixin.dart:509)
<asynchronous suspension>
#1      V3._query (package:tmdb_api/versions/v3.dart:120)
<asynchronous suspension>
#2      TmdbApi.getDetailBySearch (package:miru_app/data/providers/tmdb_provider.dart:15)
<asynchronous suspension>
#3      DetailPageController.getRemoteTMDBDetail (package:miru_app/controllers/detail_controller.dart:259)
<asynchronous suspension>

Acknowledgements