larastreamers
larastreamers copied to clipboard
Stream should be checked before tweeting
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.
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?
@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 💪
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
Hey @mathiasonea, did you start working on this? No issue if not, please just let me know.
@christophrumpel no, unfortunately I didn't have as much time for this as I'd wanted to..
No worries, just good to know 👍