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

Feature: New metaprovider for iTunes music #1009

Merged
merged 4 commits into from
Jul 8, 2021
Merged

Conversation

Ivan12273
Copy link
Contributor

Context: How I mentioned in this issue: #1005 I added iTunes music API as metaprovider.

Hello, I did some modifies on rest/iTunesPodcast.ts, I changed the name to rest/iTunes.ts and added functions for request music. I also created meta/itunesmusic.ts and Implemented the MetaProvider functions.

I ran the tests, I did not have problems, here is a video of how it works :)

Nuclear.Music.Player.2021-07-07.09-21-34.mp4

@nukeop
Copy link
Owner

nukeop commented Jul 7, 2021

Hmm timeout after 20 minutes on mac, which is typically much faster. Not sure if it's related to the PR

@Ivan12273
Copy link
Contributor Author

Hmm timeout after 20 minutes on mac, which is typically much faster. Not sure if it's related to the PR

I see, I am trying to figure out why, I only modified files from core folder so I do not understand what happened.

@nukeop
Copy link
Owner

nukeop commented Jul 7, 2021

Maybe Github randomly gave us a weaker machine for this run. It's fine.

.filter(artist => artist.artistType === 'Artist')
.map(artist => ({
id: artist.artistId,
coverImage: '',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too bad they don't have images for artists 😔

Copy link
Contributor Author

@Ivan12273 Ivan12273 Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I tried but it would require a lot of API requests :/

@nukeop
Copy link
Owner

nukeop commented Jul 7, 2021

Thanks for the contribution. I reviewed the code, it's pretty great. Could you please write some tests to cover your changes? Either unit tests for the provider or a larger integration test for the search box with this provider being selected.

@Ivan12273
Copy link
Contributor Author

Thanks for the contribution. I reviewed the code, it's pretty great. Could you please write some tests to cover your changes? Either unit tests for the provider or a larger integration test for the search box with this provider being selected.

Alright, is there any reference that I could use? :)

@haidang666
Copy link
Collaborator

haidang666 commented Jul 8, 2021

Thanks for the contribution. I reviewed the code, it's pretty great. Could you please write some tests to cover your changes? Either unit tests for the provider or a larger integration test for the search box with this provider being selected.

Alright, is there any reference that I could use? :)

one of those file is unit test you can reference.
/~https://github.com/nukeop/nuclear/blob/master/packages/core/src/rest/audius.test.ts

@nukeop
Copy link
Owner

nukeop commented Jul 8, 2021

I'll make sure to write some guidelines for creating new tests soon.

@codecov
Copy link

codecov bot commented Jul 8, 2021

Codecov Report

Merging #1009 (9d6a2f9) into master (a526a58) will increase coverage by 0.90%.
The diff coverage is 85.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1009      +/-   ##
==========================================
+ Coverage   59.66%   60.57%   +0.90%     
==========================================
  Files         269      272       +3     
  Lines        4698     4781      +83     
  Branches      302      304       +2     
==========================================
+ Hits         2803     2896      +93     
+ Misses       1637     1625      -12     
- Partials      258      260       +2     
Impacted Files Coverage Δ
packages/core/src/plugins/meta/itunesmusic.ts 65.85% <65.85%> (ø)
packages/core/src/plugins/meta/index.ts 100.00% <100.00%> (ø)
packages/core/src/plugins/meta/itunespodcast.ts 70.37% <100.00%> (+44.44%) ⬆️
...ore/src/plugins/meta/metaMocks/iTunesMusicMocks.ts 100.00% <100.00%> (ø)
...e/src/plugins/meta/metaMocks/iTunesPodcastMocks.ts 100.00% <100.00%> (ø)
packages/core/src/plugins/plugins.types.ts 81.81% <100.00%> (+1.81%) ⬆️
...ges/core/src/plugins/stream/iTunesPodcastPlugin.ts 13.88% <100.00%> (ø)
packages/core/src/rest/iTunes.ts 100.00% <100.00%> (ø)
packages/core/src/rest/index.ts 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a526a58...9d6a2f9. Read the comment docs.

@Ivan12273
Copy link
Contributor Author

@nukeop Hi, I just added unit tests for rest/iTunes.ts, meta/itunesmusic.ts and meta/itunespodcast.ts.
I also created mocks and added them to a new folder: core/src/mocks

@nukeop
Copy link
Owner

nukeop commented Jul 8, 2021

I noticed that you put your mocks in a __mocks__ folder, which has a special function in Jest - it's used for manual mocks that automatically replace corresponding modules: https://jestjs.io/docs/manual-mocks
This shouldn't break anything, but it breaks this convention in a confusing way - can you move them to be adjacent to tests? Or in a folder with a different name.

@Ivan12273
Copy link
Contributor Author

Ivan12273 commented Jul 8, 2021

I noticed that you put your mocks in a __mocks__ folder, which has a special function in Jest - it's used for manual mocks that automatically replace corresponding modules: https://jestjs.io/docs/manual-mocks
This shouldn't break anything, but it breaks this convention in a confusing way - can you move them to be adjacent to tests? Or in a folder with a different name.

Ready, I moved it and changed the name, it is fine?

@nukeop
Copy link
Owner

nukeop commented Jul 8, 2021

Looks great, thank you.

@nukeop nukeop merged commit 1cbe9d9 into nukeop:master Jul 8, 2021
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.

3 participants