Giter Club home page Giter Club logo

mangadex's Introduction

๐Ÿ‘‹ Hi there

My name is Akinyele Cafe-Febrissy. I'm a Software Developer on the web ๐Ÿ›๏ธ.

Most of my time is spent making my life and others' easier. I build for the long term and thrive on collaboration and trust.

๐Ÿ”ญ I'm working on...

  • ๐Ÿ’Ž A Mangadex gem that interacts with their latest API. Check it out!
  • ๐ŸŽฅ Don't know where to watch anime? Go on youranime.moe to find out!
  • ๐Ÿšง [Work in Progress] A simple Mangadex Client! React Native. More details on here.
  • ๐ŸŽฎ A space for watching and sharing Nintendo Switch clips (misete.io)
  • ๐Ÿค– A cool Github bot on Discord to simplify my workflow (closed source).
  • ๐ŸŽจ Constantly revamping my portfolio (akinyele.ca)

๐Ÿ“ซ How to reach me?

Send me an email to [email protected].

mangadex's People

Contributors

dependabot[bot] avatar royalgiant avatar thedrummeraki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

royalgiant

mangadex's Issues

Keyword Arguments Issue

@thedrummeraki
Trying to understand for the life of me how to make this conditional...

args = {
      limit: @limit,
      offset: @current_offset,
      available_translated_language: ['en', 'uk'],
      includes: [:cover_art, :author, :artist]
}
args[:title] = params[:search].to_s if params[:search].present?
args[:included_tags] = [params[:tag].to_s] if params[:tag].present?
@mangas = Mangadex::Manga.list(args)

,

I'm trying to include the title and included_tags args only if they exist (user has inputted). But if you run that above code, you'll get

ArgumentError (wrong number of arguments (given 1, expected 0)):

Screen Shot 2022-11-05 at 4 42 43 PM

Not too familiar with the keyword args here. How do I do this correctly?

Thanks,
Donald

def self.list(**args)

Is there a reason to run API version recognition upon require

Hey,

I'm talking about this line: https://github.com/thedrummeraki/mangadex/blob/culture/lib/mangadex/api/version.rb#L21

It makes a request to mangadex API the moment the package is required. What that means is, when working offline (say in an airplane) or doing any type of pre-building, rake tasks, etc it triggers call to Mangadex.

This can have impact not only on the code but also on the mangadex API in terms of number of requests "for nothing".

Introduce integration tests

Background

This gem is lacking robust testing. There are some unit tests for some of the core functionality, however most of the code remains untested. I would like to:

  1. Improve the test coverage for other core functionality, such as requests.
  2. Implement integration tests with cassettes (vcr).
  • The goal here is to record all traffic locally, check it in with version control.
  • There would be a test that ensures that the gem uses the same Mangadex API version as what's recorded.
  • If a dependabot or any other PR is open, it should catch bugs and even potentially regressions.

If there's a better way to do this, the linked PR to this issue will include details on the updated approach.

Use Mangadex OAuth/OpenID Connect

Context from Mangadex announcement: https://discord.com/channels/403905762268545024/839817812012826644/1050086487431053363

Quote:

This will happen over a longer-than-usual deprecation period, mainly because we don't know for sure what 3rd-party clients will need from it in terms of adjustments.
If you want your client to work with it long term, now (ie over the next few weeks) is the right time to actually test it out and report to us.
There is no huge rush, as we will support both the old raw username/password and the new OAuth system concurrently, but eventually we'll remove the old one once we believe all fair third-party client demands are addressed.

For now, the following are the relevant resources you will want:
1. The OAuth-aware API instance to use is at: https://api.mangadex.dev/. Note the .dev. It is NOT live on our live API yet.
- The API should accept tokens from that identity provider for any audience in place of the old authentication system's session/refresh tokens. It's the same Authorization Bearer header setup as on the main site once you have your tokens.
- /auth/login and /auth/refresh still exist and work; this is for backwards compatibility; if you use them you're not actually testing the OAuth setup
- The documentation doesn't mention OAuth yet, we know.

2. The identity provider is at https://auth.mangadex.dev/realms/mangadex
- The openid-configuration is at the standard https://auth.mangadex.dev/realms/mangadex/.well-known/openid-configuration subpath; which is what libraries will likely ask of you if using one
- Your personal account console is at https://auth.mangadex.dev/realms/mangadex/account
- All users have been imported in it with their roles as they were on the main website as of December 4th 2022
  - Your live website credentials as of that date will work on the identity provider login form
  - You may use the forgotten password flow if you forgot/changed them since
  - You may NOT sign up new accounts on it at the moment

3. Registering your OIDC Client
- There isn't currently any way for you to do this. We will obviously address this by the time it goes live.
- For now, you may use the thirdparty-oauth-client public OIDC client with the Authorization Code Flow.
- Its allowed redirect URIs and origins include http://localhost/ on ports (implicit) 80, 8080, 8000, and 3000, and https://localhost/ on ports (implicit) 443 and 8443. Went with the most common ports in the wild. With any subpath you like. If you really need another one ask in #dev-talk-api.
- If you believe your client will need other flows, tell us so we can evaluate and plan around the security measures this will require. If you don't ask, you won't get it.
- But do not waste your time asking for Implicit Flow support just because it's simpler. Use a library instead and the authorization code flow. There are security reasons for why the implicit flow is deprecated everywhere.

Upgrade gem to 5.10.0

Background

In order to stay as up to date as possible with Mangadex's API, the version needs to be bumped to 5.10.0 as well as ensuring full compatibility with the API.

Remove activesupport gem dependency

A handful of methods from ActiveSupport are used here. Since this gem was originally living in a Rails project, I added activesupport as a dependency but I would like to get rid of this dependency as this gem may be used in non-Rails projects.

Some example of methods include:

  • .present? and .blank?
  • .with_indifferent_access
  • .to_query

The majority of these methods can be re-implemented without needing the complexity of the entire ActiveSupport gem.

Before doing that, we will need to write some tests in order to make sure nothing breaks when removing active support.

Write better documentation

All of the documentation will be living here. As of today, it is incomplete.

Below is a list of PRs that are responsible for documenting each aspect of the codebase

  • Mangadex::Api
  • Mangadex::Internal
  • Mangadex::Artist
  • Mangadex::Auth
  • Mangadex::Author
  • Mangadex::Chapter
  • Mangadex::ContentRating
  • Mangadex::CoverArt
  • Mangadex::CustomList
  • Mangadex::Manga
  • Mangadex::Relationship
  • Mangadex::ReportReason
  • Mangadex::ScanlationGroup
  • Mangadex::Tag
  • Mangadex::Upload
  • Mangadex::User
  • Mangadex::MangadexObject
  • Mangadex::Types
  • Mangadex::Version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.