larastreamers icon indicating copy to clipboard operation
larastreamers copied to clipboard

Stream should be checked before tweeting

Open christophrumpel opened this issue 3 years ago • 6 comments

Today a tweet about an upcoming stream was published. The stream was already changed on Youtube, but still wrong data on Larastreamers.

Let's update a stream before we send a tweet.

christophrumpel avatar Feb 04 '22 11:02 christophrumpel

Would we do that by executing the ImportVideoAction Job with the existing stream to make sure the stream is up to date?

maybe something like this in the handle() method of the TweetStreamIsLiveJob and TweetStreamIsUpcomingJob

    $this->makeSureStreamIsUpToDate();

and its implementation down below

    protected function makeSureStreamIsUpToDate(): void
    {
        $this->stream = app(ImportVideoAction::class)->handle(
            youTubeId: $this->stream->youtube_id,
            languageCode: $this->stream->language_code,
            approved: $this->stream->isApproved(),
            submittedByEmail: $this->stream->submitted_by_email,
        );
    }

Or do you think it might make sense to introduce another Job UpdateVideoAction which receives only the youtube_id to make sure we don't have to think about the other parameters when we only want to make sure that specific Video's data is getting updated in our database?

mathiasonea avatar Feb 15 '22 01:02 mathiasonea

@christophrumpel It's about the handle() methods in the TweetStreamIsLiveJob and TweetStreamIsUpcomingJob. Sorry, I had it wrong in the initial issue description.

We could re-use the ImportVideoAction because it already does what we want (update an existing stream). But we have to pass the other parameters, (languageCode, approved, submittedByEmail) otherwise it would overwrite these.

BTW Thanks for mentioning this issue in your latest stream, it was cool seeing you trying to tackle this 💪

mathiasonea avatar Feb 15 '22 11:02 mathiasonea

Hey, thank YOU for tackling this in the first place :-) Yeah, let's re-use this action for now with the tweet jobs. Once it is done, we still can think of a "cleaner" solution.

Let me know if you need help with the implementation or the tests. thx Mathias

christophrumpel avatar Feb 15 '22 12:02 christophrumpel

Hey @mathiasonea, did you start working on this? No issue if not, please just let me know.

christophrumpel avatar May 11 '22 06:05 christophrumpel

@christophrumpel no, unfortunately I didn't have as much time for this as I'd wanted to..

mathiasonea avatar May 11 '22 06:05 mathiasonea

No worries, just good to know 👍

christophrumpel avatar May 12 '22 06:05 christophrumpel