oh I just realized my mic's on this whoops
alrighty how's it going everybody um so
I have a small thing that I want to fix in this Stream So I have tomorrow's
lesson set to I'm trying out this YouTube premieres thing for the first time and I realized that it shows the uh
description the full description for the soon to be video um which has a link to the actual lesson
now if I click on that link it works okay so long as I'm logged in oh look at
that undefined whoopsie doozle um I think that's cached I need to take a look at that but
um yeah so I see the lesson okay but if I log out
well that's another thing that I need to get to eventually is to return you back to the previous page but if I log out
and I try to go to it now I get a 404 page so what would be great is If instead of a 404 this displayed
um something like a coming soon since the lesson's not technically this isn't technically a four or four it's just
it's not released yet so that's what we'll be doing today is getting this from a 404 to more of a coming soon page
while also allowing me an administrator to still come in here and make edits and all that fun stuff
so let's see so we have the code base here and the primary thing within here I
think is in the um lessons controller that's actually causing this to throw the 404 so if it's not viewable and the
user is not an administrator then it throws this exception which has a 404
status code so first thing would be to get it to not
throw the 404 so let me go and make sure that I log out am I logged in locally
still I am so let me copy this sign out go back to it let's
get our 404 all right cool so step one get it to be not be a four or four so uh
post is visible would be
model post
it's always is it viewable my bad um so it checks whether or not it's public or unlisted so if the state is
public or unlisted um
if it's not if it doesn't have a publish that date it looks like it's just returning back the return the the value of this check
otherwise it's checking to see whether or not it's past the publish app
um
so we might be okay to
hmm
let's add another computed in here
do is I don't know something like coming soon
and we'll perform the same check
and just return back the response of
let's see yeah we'll just duplicate this
foreign
so if it's public or enlisted and it doesn't have a publish at which all of them should since it gets
Auto set anyway but we'll keep that there just in case um so is past publish at equals this
publish at diff now as seconds so it's differentiating from now
and looks like it checks this to make sure that that's truthy and is past publish at is less
than zero so I take it that if it's greater than zero
then that would mean that it is coming soon
all right so let's try that I think that's the
only change that would need to happen there um probably be good to extract that out
into something different but let's get it working first so
let's see so post is viewable
let's do const
is viewable and
I don't even know what the use case would be to where it's viewable but not
it's not viewable but it is coming soon because it checks to make sure that it's
public and unlisted and then it's checking hmm
all right let's check our
coming soon first let's see what this does so let's um
I'm just going to change the exception so instead of throwing a 4 4 with this
we'll say coming soon so if post is coming soon
then throw an error saying coming soon Okay cool so that's coming soon
um let's create another lesson so that we can test to make sure that
that's not going to have an edge case where that would not be what we want
all right so something like that
post publisher would be
well I guess that would just be making sure that it doesn't throw an error if we try to view another one which it
doesn't look like it does so that seems to be what we want there so if is coming soon
then
I might be doing this dumb let's see if there is
so essentially all we want to do is flip the is viewable check to check whether
or not the post is not public and not unlisted um I don't know if I have another thing on
here that would I don't think I'd do so let's do
is not public let's flip the is viewable is not
viewable all right does not equal public
and does not equal unlisted and let's actually just return that
since none of the other stuff matters all right so it is not viewable
so let's check this so let's undo that is not viewable make sure that we get
past this which we should because this is a public post
okay um oh I'm logged in again oops so yeah okay so we got past it
um so then we want to do if it's
replace this with that so I'm going to cut that out
and do Post dot is not viewable else if
not post viewable
um I'll clean this up here in a second but also not an admin Oops I meant the copy not cut
all right then
what would be probably best is to not reuse this View and not put any differentiating logic within the view in
itself but to actually just have a different view so let's return view render
lessons slash unless something like soon um
and then we have the post up here so that we can get the title so that we can at least show like a working title if if
there isn't a strict one set already so we'll provide that
and yeah that should be okay so we'll save that come down to lesson show and
I'm going to copy this and paste it in here and rename it as soon
.edge [Music] um
definitely wanted to have a non-index flag so that Google doesn't try to index
it um I think the rest of that stuff would be okay to keep as is
well no because this will set a well yeah no it is still the same URL so that
should be good too and then I don't think we have the series
information coming through and maybe that's on the post in itself yeah it's got four display on it so that
would be no that's that's not reaching through a Series yeah okay so series is down here
so we don't have the series but I would prefer to have it for this
so maybe we move that above the if check up to here
I want to make that a const I don't know why that one's not a const and then
so now we should have the series so we should be able to keep this because it would be nice to be able to still go to and from different lessons once you see
that it's coming soon and not presently available um
and then I don't think that's applicable to live stream and then
that would be the embed which is okay to show because if you try to click on this all it's going to do is show the
premieres in so it's not gonna it's still technically works it serves its
purpose I guess so then
all of that would be the post information which I think would be okay the reading watch time is probably going
to be inaccurate especially if the video in itself is not published yet that's going to
be something that I manually provided in there so that wouldn't be something that we would want in there nor the buttons
um play plus YouTube yeah so those are
those action buttons that appear at the bottom of the title panel so then that would leave us with the series name
title and description which is good and then we do an additional check if there's not any assets to display it
with the top section so we just need to replicate what we
removed up there down here so that would be this div would it uh yeah
that'll be that div and then the mark complete stuff and all that fun
stuff down through there would get removed and then obviously the post body would
get well yeah yeah the post body would get removed but probably put something else in its place
um and then remove the comments
and I think the rest of that would be okay to leave it in there so
um and then we'll I don't know display something like um
put that in there as a filler for right now just to see okay I'm going to close that Tab and I'm
going to log out let me copy this URL once more so all right now I'm going to log out and I'm going to go back
to into here first check and make sure that that still loads in which it looks like it does
come into this one all right so the series information is gone which is weird
but it does show the this lesson is coming soon so oh I know what the series
information is showing oops definitely I don't want to print that I didn't add it
into the information so series there we go
there we go all right so now we have
um yeah and it's not going to show up within the series because that's how it's within the query on that I think
that's right because if you're getting if you're getting to this page it's it's by accident I didn't mean to have this
out but if you're getting to the page um definitely want to show that there's a reason for this page existing and
having a link so that's the primary purpose behind the this lessons coming soon messaging
um foreign I don't know if I can check whether or
not the um hey tomek CI uh thanks for stopping by
sorry I didn't look up um but yeah so I if if it's not a
Premiere which I I don't know whether or not that's something I'll continue to use I have not used it before so I
really don't know its usefulness just thought I'd try it out um but if this is not a Premiere then
this will just show like that gray screen with the gray play button
and I don't know whether or not I can detect that
um I would probably say not
you know what it would be good to have this not be so far down but rather just kind of maybe maybe a
hover bar on the bottom or something a fixed bar or something like that
because it doesn't make sense to have to scroll down to see that it's coming soon
[Music] um
so let's see so we'll get rid of
it doesn't make sense I have an ad on it either um
get rid of that um I'll leave that on there we'll get rid of all the ads that you know serve a
purpose on this page at all um
we'll leave the I guess the the title bar here
oh well that does move that over doesn't it so I do need a empty div to at least
push that over I think I don't know whether it's flux between her no okay
let's try glass with full oh that's a little bit too much
all right let me go back all right so we'll just we'll leave that body copy div in here
let me get rid of these ads again all right
there we go that looks proper so
probably put an image or something in here but yeah let's put a fixed bar down on the bottom
so where would be a good spot well we have this admin bar that's fixed so right
probably right here would be all right so div class [Music]
foreign
I think it's BG gradient no that doesn't look right I think it's
just gradient from
Gray 700
2 Gray 9.50 something like that
let's do py6 oops
and fixed bottom zero left zero width oh
and then let's plop a H2
let's see what that does oh okay evidently I got the background
maybe it is beachy gradient didn't look right oh it is BG Grady all right
that's not a great look and then we'll put this inside of my
container component
so maybe we'll just do a flat color BG
gray 950 with an 80 opacity
yeah that's all right um what's that uh see there's a backdrop
blur class that'll blur out the background so that it's not as competitive against the actual
content so let's see what that is I think it's
backdrop something backdrop blur yeah
let's try it with just the base uh it doesn't seem to be doing anything
maybe LG I might not have this version of Tailwind that might be
outdated I'm working on a re on a redesign where I updated Tailwind so this version is probably older so it
probably doesn't have that in it so instead what I'll do is let's try 95 opacity
yeah that'll that'll be all right and then text White
hey Mick Mark thanks for stopping by um so I'll do something like that
this lesson is coming soon um we'll be releasing and so I think
there's there's like the time until I think that shows the um
yeah so something like this um let me go see what that's reading
so Studio where's the studio posts
index and then that would be oh it's just all
right so it's time ago off of the post so come in here
will this um
I'm going to copy what YouTube uses what do they say that's the wrong thing
they remove oh no I did I just need to scroll down premieres in 16 hours so
premieres and and then it should be what post and then time I go all lower case I think it was
boom check that out why is in in there twice oh okay one of
the ends is on the time I go so let's do that and then we'll do
capitalize I guess the CSS class to make yep okay cool so premieres in 16 hours
uh see please check
uh I don't even know what to put for that the content has never been like my my
go-to I always end up looking to everywhere else for resources on that
yeah all right please check back and we'll put the actual date and time in there I guess
um
let's see please check back
um
probably good to have an icon besides that too make it look a little bit more
right something kind of like we have with the although the titles coming through is
undefined for whatever reason something similar to the live to make it stand out a little bit better
um foreign
I always forget what the icon thing I use is
there it is came to my head all right so let's do
maybe a clock let's do time
and then I put all of my icons in a component and then I have SVG
and do
clock oh I already have a clock okay then so then we'll do
div class Flex
spacex3 we'll do a div for the icon and then we'll do
another div class Flex Flex call for the title and whatever I end up
coming up with for the subtext I let's put ASDF over right now
and then at SVG dot clock
probably width 6 H6 something like that would be okay
we'll make this text smaller
okay and then let's Maybe 10.
let's try eight and then we'll Center it
that should be fine
okay that works and then um
put something fun in the body copy
uh well I can do that off screen
uh but yeah I'll put something fun there and then that will uh fill that in a little bit better so all
right so now you come onto the page you can see this um maybe I'll make the color pop a little
bit more on the title
foreign
that does not look centered looks slightly bottom left
or just left is there space in there or something let's get tell you what I'll do negative margin
right pixel it looks better I think this is slightly
too big
yeah that just looks weird
what about if we just do one bigger
yeah that looks a little better now it looks too right
no I can never get it right all right now it looks to left a pixel's not going
to make that big of a difference hmm I think it looked more right here
that's the darnedest thing all right so that that works um so now if you accidentally arrive to
this page via this you would come to this page and
I don't know there's a lot going on whenever you first enter this page in there hmm
it's not very it doesn't despite it being the accent color it doesn't pop too much it's one of the last things
that you see whenever you looking through everything
but I guess this is an edge case that we're catching so I guess that's good enough because if you try to play the
video you still see it and if you try to scroll down the content that's where this becomes more evident
so I I I think that will suffice for the purpose while I'm streaming let me
see if I can fix this um so let me um
instead of recreating that because I'll probably mess up whatever it is that I accidentally
didn't correctly so I'm going to drag this off stream just in case it opens up anything
okay so let me go file backup well I guess I
didn't need to open that up at all I think you don't need to do that to get in here all right so back up let me find
here there back it up all right let me overwrite the backup
that I had just created to get the post for tomorrow into my local let's replace it
all right so the backup completed there well let's do restore so file restore
select that file all right restored now so now if I come
back into my local and refresh oh yeah see this is just a cash issue it
shows up okay here hmm all right
so I removed the cache on like all of the
content items because it caused some issues whenever I was going to publish to where it caused it to not immediately
publish and it caused like my Twitter announcement and the YouTube stuff to be out of sync a little bit
with whenever it actually hits the site so I went ahead and just removed that until I have time to add proper job
scheduling to get that to be liquidy split um I guess I forgot to remove it here
maybe is the case so let me go take a look and see what's populating that
it's been a minute so I haven't looked that since I actually implemented it so uh
I don't know if that's in the App State yep right here so check live so
that does this hold I thought um
okay if a weight cache service has is live
then return it
otherwise post query where true is live or not true live stream URL or we're not
in all apply the published check order by publish it and grab the first and then
set that in there so what's weird is that it's picked up
that we are live but it doesn't have the live post that's
bizarre does it at least link now links to undefined hmm so it doesn't have the
post at all but ironically if you come in the
streams it picks it up just fine there hey look you can see what I'm looking at
um
that is the darndest thing I don't know why that would pick up that it is live since the is live check is the existence
of the post data like there's no other
like that is the check is whether or not the post date is there so it's weird to me that it wouldn't pick up
so let me go see what component that is that's actually rendering and see whether or not it's maybe just
I don't know so that would be in the layout my alphabet is just off today looking
down on the s's for the L's um Main
that's going to be down so if live and request well
yeah so live is that app state that we were looking at
before so live is the return of this which in return would return back the
existence of our post which would be the post in itself
what is serializing it I wonder if maybe the
no because it works locally so it wouldn't be that wouldn't be that this is expecting
different properties to show up properly
so let me go into Strings Banner
and it is just post title
all right
oh I'm looking at the wrong thing uh so let's see
maybe we just try to get rid of this cash because that would fix it if it still
comes back as undefined without the cash then actually do I have an application on
here
no that's well maybe that is the one that's tied to one of these I have two redis applications one I
doesn't seem like this one's to open when I tied to production when I tied the logo
I don't I can't recall whether or not I actually got the production one reading right though
yeah I don't think I did I kept getting the config and all there and I think that's because it'll have permission
from where this is trying to connect um
all right so yeah I'm gonna try pushing this out to production we're going to test in production here live on a stream
um so so let's do git status all right
I'm just going to push out the
was this the post service
oh I gotta reset everything else
there we go
okay
so we just gotta wait for that to hit the production
um
so I'll get a message here we can verify that within Discord in the meantime let me go ahead and boot
my server back up you know I probably should have uh made sure that the page still rendered
okay do that real quick I can cancel the deployment if it doesn't
yeah okay still render's good we're not going to break anything um
oh I have a purge all cache button I put in
there that just clears out everything yeah okay so it's still in there so
that's bizarre though
hmm yeah that's definitely in the past and that's definitely set the live
stream and it's definitely set to is live it could be this uh URL though maybe
it's a little funky I don't know ah
um sorry the build failed I realized that you guys didn't get that notification I did um
so cash service is no longer used so it's
all right
all right there we go so we'll see um we gotta wait for that to build again
foreign Ed as
undefined
I don't know I I really don't get how that can happen it's not making sense to me
to where it would be truthy but still
well yeah I guess that would have to be it is that it's getting cashed as undefined
or maybe I don't have redis running locally uh no it's not not an AC like oh what is
it pseudo service uh
uh redis server
yeah it's like I found it
ready to accept connections okay all right I thought that had a
background task but all right so long as it's running that's all that matters so let's
get you back up all right and then let's put these back
in here yeah let me uncomment this
and reload and reload again ah sure enough we have
replicated it cool sorry it took me a minute to realize
that I could that I didn't have redis running and that's why it wasn't being replicated I thought that I had it
automatically starting every time that I booted up my computer evidently I need to check on that so
um let's see most likely it's going to be that it's cached as undefined so let's
go back to the app cert no it was um the check live check
so let's do console log
and let's get is live to see what exactly it's got going on but I guess it's an undefined string oh
it's object object it's object object
that would do it too well yeah because the title was undefined right not the object in itself but the title so there
is no title object off of object object string all right so why are you
caching as undefined or as object string
serialize I thought maybe this one's not but no
oh I need to call set serialized
yeah but still you're serializing on the outside so it should turn it into a string no
no this one returns back the model serialized model so it's still an object
let me switch to my set serialize method and switch it to just providing it alive
no um and you know what let's improve that
check oh no that is just a has isn't it
yeah all right so let me log in
Purge me cash come back into here it's still undefined wow
hmm all right let me go look and see what
come back there you go and this that's the one
oh oh no it's not the one wait yeah okay there we go
so it is like oh dang it Tom you just need to parse it
all right Jesus all right so I think I have get parsed
yep
there we go all right oh gosh
all right cool so now we we have getting back to um it being cached for five minutes and
then um properly getting it to where we can get the title and
links to it this should be showing something though
shouldn't it some kind of video right I think it's supposed to be the equivalent of this
I just changed this I haven't pushed it out yet but I I might have broken it so like if you come in here I switched it
to where I had had the thumbnail poster over it with a custom play icon and then this YouTube embed didn't actually load
until you hit play um I want to test putting this I used to have this embed in here like this it is
now I want to test this again because I saw that YouTube was it used to recognize this video and I
think the way that I had switched to which is the weather that's currently out on production so like if you come in here
you get this little play icon and all that and then I auto play it once you click the icon
I want to test whether or not they're taking away the views for the video whenever you have it like this as
opposed to this so that's I'm gonna this will be on production whenever I next push but
um so I might have broken not this but this
because it should have a stream display up here and I'm pretty sure that this uses this exact same
lesson show page so if I go into it has its different
controller I think maybe not
I thought it did is it live streams oh yeah it's live streams it's looking for streams
so index and the show oh look at that that has the same thing
um all right let me copy this over to here I probably need to do that
from news and blog as well so copy that that does not need a series in there
oh no we can take this series put it up here as well
all right probably need to do the same one here I would assume yep
ah I'm gonna hit copy instead of paste
all right there we go and I think I have one more posts that's the
blog which nothing's posted to and doesn't even have this check so all
right so all right so let's go back into here and let's
see what right yeah so it's rendered out by the lesson show as well
um so let me look on the page to see whether or not there's an error showing
up it could be the actual URL
yeah it looks like it's just the um uh Google ads errors showing up the
double click stuff so that looks right we do have
an iframe nope that's add
so it would be above this container here but below the main and it does not well
actually I don't think it would be below the mean I think it's above the mean it's right here
I think
no that's the notification bar okay so let me just go in the lesson show
let me try uncommenting this change that I have here and see whether or not that
no it's still not showing up okay
post.livestreamurl and post.live so let's see what that value is well are we even getting there because I
don't think I saw an aspect see
okay so this is within the section content so it would be within
let me make this bigger so it would be within my main
break that's my little bar over there and there's the container I
think it's outside of the container isn't it
oh oh I see
all right I must have broken that at some point why whoa what's up with that
did I do that hmm
that's interesting I don't remember doing that but I might have done that
well I guess I would have had to have so let's see here
's the stream indicator here's that video embed I don't know where that would be coming from necessarily
oh okay
I didn't do a very good job of making those checks all the way through
that looks like it's the last one
there we go all right
I think it's supposed to auto play that though isn't it I thought
I know this page was It was supposed to autoplay it muted oh it looks like it pauses it after a bit
that might have been the new thing I put in um I switched a lot what didn't I save here
oh okay I switched the logic within the uh let's see the post.js file to have
this Auto embed I bet you it's probably hidden now it should hit the is live
do a console log and see what's going on here so console.log
let me move this down here actually see whether or not we're even getting here oh
well actually this is not run on the live stream page oh look at that it worked now
it's autoplaying let me try refreshing again see if it does the same thing
sure enough that's it I just need to have that
console log in there foreign no it's back all right it's
must be a cash issue because I have my nothing gets cashed whenever I have my
toolbar open
so that must be it which I always have this open whenever I'm deving so
it's got to be a cash thing let me try switching that
foreign I thought I did I it's one of the first
things I was doing whenever I set up my browser all right so I guess that wouldn't be it
then unless there's something else that would be changing
well that's bizarre doesn't happen when the toolbar is open
but whenever that's not open is it um
yeah okay it looks to be doing the same thing on production so if I open this up
oh okay look at that doesn't doesn't play whenever I'm on production with the dad open
all right well that's not the end of the world I'm that that's that's not a huge issue
um let me go take a look
okay see if there's anything in media that would stand out if not I'm not going to
worry about it on player ready window player equals
player at event Target mute
let me go see if that matches my auto play here so on a video
skip to seconds for the progression tracking player vars start
if is live delete the start let's get to seconds all right because it doesn't make any sense to seek to a specific
time in a live stream um autoplay
so okay but it still does have that if start muted then mute
down there and what's setting that start muted is
that a property coming from the outside element start mutant is live or auto play okay
foreign surprised
so I know I tested that and that worked fine with how this is currently set up with normal videos
um I had thought I tested it with live streams but evidently not to the extent that I should have
um well it wasn't my live stream I was testing with either so
that could have been it too um yeah so let me see if I have that auto
play set yeah that's hard-coded the trio on live streams so
it looks like it tries to play but then it doesn't it pauses but it has that
muted icon still on there I might just go ahead and get rid of it all together so like if we refresh you
can see it buffers for a little bit but it has the play and mute
so at the very least it'd probably be all right to just remove the autoplay on it and then take the mute off so that
whenever you do decide to play it it's not muted
foreign
yeah see the watch on YouTube Banner wasn't down there before so I think it was trying to play but it wasn't muted
at the time that it was trying to play so it ended up pausing it but then we ended up muting it after it paused I
think that was the flow that was going on there if I had to take a guess at it so I I'd need to take a deeper look at
the YouTube apis for that to see how I'm pretty sure I have it set up the way that it had been recommended but
I don't know if that changed I know YouTube just did a redesign so maybe they changed some stuff could take a
fresh look at it but in the meantime just so that it doesn't start with it muted and having a play
button I'm going to go ahead and just set this to um
I guess hard-coded false and I'm gonna attack it to do on that
oh all right hold on a minute I don't want to lose that property that was there play on ready okay
there we go and then
comment that out all right there we go so now if I come
back into the lesson as well that should yeah all right then if we hit play
all right there we go so that seems to be working and then uh I've got null coming up if I don't
provide a description oh gosh all right well I'm getting a phone call so I will be right back
alrighty um so I have to head out here in a minute uh so I'm going to go ahead and
wrap some stuff up here so I'm gonna go ahead and
see
let's just commit the I'm trying to think of what all we
changed during the Stream
let's fix live stream Banner cache um and then
added coming soon render to
not yet published lessons that's good enough
so I'm gonna go ahead and post that out and uh I'll double check make sure I didn't break
anything um here after that gets deployed but uh thank you all for watching
um I have a lesson coming out tomorrow at 9 00 a.m EST eastern time
um 1pm UTC and 2 p.m GMT if I have the time frames right there so be sure to
check that out it's on migrations as I'm sure you've seen here on the stream so
um yeah thank you all for stopping by have a great one and I'll see y'all tomorrow
foreign
Join The Discussion! (0 Comments)
Please sign in or sign up for free to join in on the dicussion.
Be the first to Comment!