-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
This is absolutely fantastic. Although, before I merge it, is there a reason for moving the manga constructor to |
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. |
I cannot find any use of
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. |
I think I changed my mind while writing this. I'll undo the constructor change. |
I went ahead and reverted |
* 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>
Fix #55