New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Extended Weekly Schedule Widget #565

Open
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
5 participants

xabispacebiker added some commits Dec 22, 2017

Update Show.php
Modified getNextShows SQL to retrieve additional fields
<script>
$(document).ready(function() {
$("#scheduleTabs").airtimeWeekSchedule({
sourceDomain:"https://airtime.97irratia.info/",

This comment has been minimized.

@hairmare

hairmare Oct 15, 2018

Member

I think we'll need to make this URI dynamic.

This comment has been minimized.

@xabispacebiker

xabispacebiker Oct 15, 2018

Contributor

Ups, yeah.. nice catch

miscText:{time:"Time", programName:"Show name", details:"Details", readMore:"Read more", defaultGenre:"Radio", nowPlaying:"on Air now..."},
backgroundColor: "#d52a33",
textColor: "#fff",
programImage: "https://97irratia.info/wp-content/uploads/2015/03/6461315162291g.jpg",

This comment has been minimized.

@hairmare

hairmare Oct 15, 2018

Member

This one as well...

@Robbt

This comment has been minimized.

Copy link
Member

Robbt commented on 5447f58 Oct 15, 2018

Do you want it to be reverted to the previous version ? I'm not sure what motivation in removing it is or how to remove a specific commit so I'm just trying to figure out why you want it to be removed so we can figure out if there is an easy solution.

This comment has been minimized.

Copy link
Member

hairmare replied Oct 15, 2018

I don't think the GitHub web UI has a feature to do so.

You'll need to checkout the code locally and use something like the cherry picking method described here: https://www.clock.co.uk/insight/deleting-a-git-commit. You best bet might be to do this on a new branch and then force push that onto your libretime-widgets-v3 branch.

This comment has been minimized.

Copy link
Member

hairmare replied Oct 15, 2018

Another option would be to run git revert 5447f58693398a7b9153d2c15779c41f3aab2b24 on the branch, that will add another commit that undoes the change.

I made a local copy of your branch so I can help restore it if anything goes haywire 😉

This comment has been minimized.

Copy link
Contributor

xabispacebiker replied Oct 15, 2018

Do you want it to be reverted to the previous version ? I'm not sure what motivation in removing it is or how to remove a specific commit so I'm just trying to figure out why you want it to be removed so we can figure out if there is an easy solution.

I'd like to remove it because it has no sense on this branch, this branch is supposed to be the modifications for an extended widget schedule and those translation should be applied in another branch.

This comment has been minimized.

Copy link
Contributor

xabispacebiker replied Oct 15, 2018

I do not understand. I just created a new branch adding just a new file (VERSION) and when trying to create a pull request, the airtime.po commit appears again.. in this new branch. How is this possible !?

Update widget_schedule_v3.html
Updating hardcoded urls
@Robbt

This comment has been minimized.

Copy link
Member

Robbt commented Oct 16, 2018

I suspect that the issue might be that the commit you are trying to undo is already committed to your master branch or whatever you are forking from. I know I've seen unrelated commits show up when I didn't have my master synced to the main libretime master repo. I don't know I'm not a git master, but hopefully we can figure this out.

I was also thinking that ideally we would have some sort of choice for people, like different widgets/themes they could use, but that is outside of the scope of this commit.

@xabispacebiker xabispacebiker changed the title Libretime widgets v3 [WIP] Extended Weekly Schedule Widget Oct 16, 2018

@hairmare

This comment has been minimized.

Copy link
Member

hairmare commented Oct 16, 2018

Hey @xabispacebiker I think I realized what went wrong. Do you have a local working copy? If so, could you please post the output of git remote -v? I'll write up some step by step instructions to get you recovered, but you'll need to have a local working copy to follow them.

@xabispacebiker

This comment has been minimized.

Copy link
Contributor

xabispacebiker commented Oct 18, 2018

Hey @xabispacebiker I think I realized what went wrong. Do you have a local working copy? If so, could you please post the output of git remote -v? I'll write up some step by step instructions to get you recovered, but you'll need to have a local working copy to follow them.

Hi @hairmare , I do.. this is the output:

origin https://xabierarrabal%40airean.info@github.com/xabispacebiker/libretime (fetch)
origin https://xabierarrabal%40airean.info@github.com/xabispacebiker/libretime (push)

@xabispacebiker

This comment has been minimized.

Copy link
Contributor

xabispacebiker commented Oct 18, 2018

I am thinking of removing this pull request as I have realized there is another one which is more integrated with libretime #443

@Robbt

This comment has been minimized.

Copy link
Member

Robbt commented Oct 18, 2018

I wouldn't remove it. We may want to create a PR that provides multiple options as a UI choice or takes the best of both of these PRs and combines them.

@hairmare

This comment has been minimized.

Copy link
Member

hairmare commented Oct 18, 2018

@xabispacebiker The po change seems to be on your master branch. I would probably recover from this as follows, just be sure to copy the airtime.po file somewhere safe as the below will remove you the change from git.

# switch to master and revert to upstream
git checkout master
git remote add upstream  git@github.com:LibreTime/libretime.git
git fetch --all
git reset upstream/master --hard
git push origin --force

# rebase libretime-widgets-v3 branch to updated master
git checkout libretime-widgets-v3
# rename working branch
git branch -m libretime-widgets-v3-old
# recreate branch with libretime-widgets-v3 name
git checkout -b libretime-widgets-v3
# cherry-pick all the commit except the po update onto new branch
git cherry-pick 210e7d34bf765656bad237298114d9c2fb4f1f9e d23a4d8a6256949b868c951de5fd007dfc7dce7d a5bced468324a7ef763951272e2cf86b8c914d53 6151068a53ae1ecb67f43c7378f4befc89a06d8a b3e771534466bdebec27fc33478c5b7ba68e0aa4
# force push new branch into this PR
git push origin libretime-widgets-v3 --force-with-lease

After this you can create a new commit with the airtime.po change by switching to a new branch after checking out master and redoing the commit.

In the future, when you want to update your master branch you should do it like so:

git checkout master
git pull upstream master

Usually we recommend not putting any changes onto the master branch and keeping it in sync with upstream like above.

@frecuencialibre

This comment has been minimized.

Copy link
Contributor

frecuencialibre commented Oct 18, 2018

i hit this same problem on a much simpler pull request. i had to stash changes, delete the branch both locally and in my fork, and then create a new branch for my PR, this time from the last commit pulled from origin :

git branch my_fabulous_contribution <commit_hash>
Update airtime.po
Revert to the airtime.po version in master branch to avoid conflicts
@JohnnyC1951

This comment has been minimized.

Copy link

JohnnyC1951 commented Nov 7, 2018

I have not trawled though all the changes, but here are some notes that might be useful to somebody. In my version, I now run it from a new folder in the public folder. This makes for easy css site wiget styling, without mangling the core and survives updates. I also cache it from a frequent cron job. The cached file is popped into a Joomla iFrame module..With suitable mod_expires in .htaccess (for all the show images) and an http2 enabled apache (I had to use newer Icecast 2.5b2 to get the green padlock for all of this - don't use tls!), it makes a huge difference to widget load time and, I guess, database load.

@xabispacebiker

This comment has been minimized.

Copy link
Contributor

xabispacebiker commented Nov 12, 2018

Definitely this pullrequest is not the best way to do it and needs some improvements, somebody requested in the forum to upload it to libretime but I know it can be done better.
@JohnnyC1951 , I used to do same as you do with cron jobs. The website server was not the same server running libretime, so I had to include an ftp command to upload the generated schedule in a frequently running cron.

I think It would be a nice implementation disallowing the direct access to web widgets and process all requests via cached files so the server does not get overloaded in case of many schedule or "on air" widget requests, the server gets exhausted when this happens.

@JohnnyC1951

This comment has been minimized.

Copy link

JohnnyC1951 commented Nov 12, 2018

I just use a one-line bash cron script that uses wget, to pull the whole schedule widget (with schedule) and saves it to file (it is DRAMATICALLY FASTER for the listener). This could be on the station's listener website or It could also all be done in the widget without a cron (e.g. if file is older than 20 mins then curl a new copy into the cache). The listener facing website simply loads the cached file into a responsive iframe. Simple, fast and works (like my women).
Side-note: I extended the api to expose more useful stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment