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.

Command icon 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

sunlix created an issue. See original summary.

sunlix’s picture

Status: Active » Needs review
sunlix’s picture

In the config method I used the constant YoutubechannelSettingsForm::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.

sunlix’s picture

I 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

i-trokhanenko’s picture

Version: 8.x-3.x-dev » 4.x-dev
i-trokhanenko’s picture

Status: Needs review » Needs work

Merge conflicts, MR#9 needs reroll

i-trokhanenko’s picture

Status: Needs work » Fixed

Commited, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.