Problem/Motivation
To modernize the youtube data access we should move the youtubechannelvideo() function to a OOP service.
This make the class testable in a future task.
Proposed resolution
Create a new YouTubeChannelFetcher class and swap out youtubechannelvideo() in the .module file.
Issue fork youtubechannel-3577017
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
sunlixComment #4
sunlixIn the
configmethod I used the constantYoutubechannelSettingsForm::SETTINGS.This would be introduced in #3576951: Provide default settings and simplify settings form.
So it would be nice to merge both issues successively.
The YouTube channel data will be cached for 1 hour. So multiple blocks would be possible without any ^n requests to the API.
Would be nice to have this merged. :) Any recommendations are highly welcome.
Comment #5
sunlixI am sorry, just found some code smells that I have fixed right now.
I think this is ready to review / merge. :)
If that will be merged the following issue is also resolved: #2858952: Block still says to configure it on the admin page, even though already configured
Comment #6
i-trokhanenkoComment #7
i-trokhanenkoMerge conflicts, MR#9 needs reroll
Comment #9
i-trokhanenkoCommited, thanks!