Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for creating mangas and covers #56

Merged
merged 8 commits into from
Jan 26, 2022
Merged

Add support for creating mangas and covers #56

merged 8 commits into from
Jan 26, 2022

Conversation

PythonCoderAS
Copy link
Contributor

Fix #55

@md-y
Copy link
Owner

md-y commented Jan 25, 2022

This is absolutely fantastic.

Although, before I merge it, is there a reason for moving the manga constructor to _parse()?

@PythonCoderAS
Copy link
Contributor Author

This is absolutely fantastic.

Although, before I merge it, is there a reason for moving the manga constructor to _parse()?

The reason I did that is that whenever I do an update, I need to re-parse the information that is sent. Obviously the version number has changed, but there's no sense in duplicating code, so I'd like to re-run the constructor. However, you can't call the constructor directly without making a new object, so I had to do this.

@md-y
Copy link
Owner

md-y commented Jan 26, 2022

I cannot find any use of _parse outside of the constructor.

Screenshot

update() is currently making a new object so is this meant to be there at all?

Wouldn't it also be possible to update the object by iterating over it with the new manga object kind of like this?

let tempManga = new Manga(data)
Object.entries(tempManga).forEach(([k, v]) => {
    if (k in this) this[k] = v;
});

I don't know how optimal this solution is though.

@PythonCoderAS
Copy link
Contributor Author

I think I changed my mind while writing this. I'll undo the constructor change.

@md-y
Copy link
Owner

md-y commented Jan 26, 2022

I went ahead and reverted _parse and updated types so I can merge it

@md-y md-y merged commit a6df1ef into md-y:master Jan 26, 2022
Stevox404 added a commit to Stevox404/mangadex-full-api that referenced this pull request Oct 4, 2022
* Add support for creating mangas and covers (md-y#56)

* Add support for creating mangas and covers

* Update types

* Add support for author creation

* Modify manga create to work with LocalizedStrings.

* Add support for not using localized strings

* Add support for updating.

* Add back constructor method

* Revert _parse and update types

Co-authored-by: md-y <midymyth@gmail.com>

* Add missing imports

* Add JSDOC Documentation

* Update github actions

* Remove left over page arrays

* Update types for 6866f92

* Add tests to GH actions & make auth based on env

* Update minimum node engine version to v12

* Add mocha tests badge

* Add test retries and node 12 support

* Add method for requesting total amount of search results (md-y#57)

* Update types for 6931667

* Update browser info in readme

* Add readableAt, locale, and mangaUpdates fields

* Update package to 5.9.0

* Update types for b8147c8

* Update package homepage and fix gh action

* Update package lock for 369bf09

* Add return type for getTotalSearchResults

* Update types for 1c0ea44

* Create npm-publish.yml

* Fix publish workflow

* Log X-Request-ID

* Allow tests to run on pull requests

* Add chapterNumbersResetOnNewVolume, availableTranslatedLanguages, and state fields to Manga

* Update types for 91181cf

* Update package to 5.10.0

* Update package lock for 6a5793c

* Move refresh token logic to another method

This way, I can call the refresh token method whenever needed, even if I shouldn't need to.

* make `getMultiple` include pornographic mangas

* Assign res as a const

Fix md-y#62

* Add contentRatings parameter to Manga.getRandom

* Update types for 8ec204e

* Fix getRandom docs and update npm version

* Update package lock for b4e2622

* Manually update types because the workflow did not trigger

* Fix getReadChapters

* Move getReadChapters() to login.test.js to be with other auth-required tests

* Skip auth test for PRs since secrets are unavailable

* Update npm

* Update package lock for c4396fd

* Added latestUploadedChapter field.

* Convert latestUploadedChapter to a Relationship

* Update types for b33299b

* Add support for tags in searches

* Update npm

* Update package lock for 00a8ec6

Co-authored-by: PythonCoderAS <sarkaraoyan@gmail.com>
Co-authored-by: md-y <midymyth@gmail.com>
Co-authored-by: md-y <md-y@users.noreply.github.com>
Co-authored-by: PythonCoderAS <13932583+PythonCoderAS@users.noreply.github.com>
Co-authored-by: Nowaaru <zackyboy135@gmail.com>
Co-authored-by: Eli Morris-Heft <eli.morris.heft@gmail.com>
Co-authored-by: spacehamster <mail.spacehamster@gmail.com>
Co-authored-by: md-y <15069105+md-y@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method to create Manga
2 participants