Skip to content

Commit

Permalink
Merge pull request #68 from swimmadude66/DevBranch
Browse files Browse the repository at this point in the history
next wave of bugfixes
  • Loading branch information
swimmadude66 authored Apr 7, 2017
2 parents 7699e8a + d07bc8f commit 02b2288
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 56 deletions.
60 changes: 12 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,27 @@
#YTRadio
# YTRadio
__codenamed LifeBoat__

Each instance of Lifeboat represents a venue in which you and your friends can DJ to an audience all over the world. What makes Lifeboat different from other DJ'ing platforms of the past is that it is light enough to be hosted as an afterthought on almost any server.


The built in chat allows for lifeboat to serve as a fun substitute for a message board or irc room. Host an instance on your company website and let your customers chat while sharing music. Run multiple instances in a docker containers to turn one server in to a de facto music room for several genres (_docker functionality to come_).
The built in chat allows for lifeboat to serve as a fun substitute for a message board or irc room. Host an instance on your company website and let your customers chat while sharing music. Run multiple instances in a docker containers to turn one server in to a de facto music room for several genres


#How to Host
# How to Host

##Method 1 - __Download a release__
Coming soon, releases will be a zipped folder of pre-minified code; you need only edit `config.json` and run it with `node app.js`
## Method 1 - __Download a release__
Coming soon, releases will be a zipped folder of pre-minified code

##Method 2 - __Build from Source__
_requires git, npm, bower, and gulp_
## Method 2 - __Build from Source__
_requires git, node, and npm_

1. Clone this repo on to your host box (or just download the zip from github, I'm not your mom)
2. `cd` in to the cloned/downloaded repo
3. Ensure gulp is installed with `npm install -g gulp`
4. Run `gulp default` or just `gulp`
5. `cd` in to the newly build `dist` directory
6. Run `npm install`
7. Edit the `config.json.dist` file to match your environment, then save at `config.json`
8. Run the app with `node app.js` or your favorite node monitoring tool like [forever](https://github.com/foreverjs/forever).
3. run `npm i`, then `npm run gulp`
4. `npm start` will host the app on the default port!

The app will start on port 8080 for http or 3000 for https. These can be redirected in `app.js` or forwarded using nginx, iptables, etc
# Development
After cloning and installing, you can run `npm run dev` to create a live-reloading instance of the app. (note, you will need to run `npm start` or `npm start-dev` in a separate terminal to launch the api)

Additionally, you can configure the app by workspace by creating and editing a `.env` fle in the project root. The contents of the file will be read as KeyValuePairs and overwrite `process.env` variables.

#Development
To edit this to your needs, simply fork this repo then edit the files in `src`. You will need `npm` and `bower` to install dev dependencies and an accessible mysql server. If you wish to contribute back to the project, submit a pull request from your forked repo targeting the `DevBranch` branch.

Below is an alternate method of testing utilizing [Vagrant](https://www.vagrantup.com/downloads.html)


### Vagrant
Vagrant creates a fresh VM provisioned specifically for this project. It's useful for maintaining a standardized development environment as well as providing a quick way for new developers to participate without modifying their host machine. To use Vagrant make sure to have both [Vagrant](https://www.vagrantup.com/downloads.html) and [VirturalBox](https://www.virtualbox.org/wiki/Downloads) installed.

First, make sure your ssh-agent is running:

```
eval `ssh-agent`
```

Next make sure your Github SSH key is added to your ssh-agent:

```
ssh-add <~/.ssh/id_rsa | path-to-key>
```

Following that, navigate to the project root and run the command:

```
vagrant up
```

After that ssh into the VM by running the command:

```
vagrant ssh
```

The virual machine will be accessible on the host machine at 192.168.33.10. Vagrant will also have your Github SSH key forwarded into the VM so you can interact with Github like normal.
20 changes: 14 additions & 6 deletions src/client/components/usercontrols/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ <h4>
</button>
</div>
<div class="col-12" *ngIf="addingPlaylist">
<div class="col-8">
<input type="text" name="nplaylistName" placeholder="New Playlist" [(ngModel)]="newPlaylist.Name" style="color:#000000;">
<div class="row">
<div class="col-12">
<input name="nplaylistName" placeholder="New Playlist" style="color:#000000;" type="text">
</div>
</div>
<div class="col-4" style="padding-top:4px;">
<a (click)="cancelPlaylistAdd()" style="color:red;"><span class="fa fa-remove"></span></a>
<a (click)="registerPlaylist()" style="color:green;"><span class="fa fa-ok"></span></a>
<div class="row">
<div class="col-12" style="padding-top:4px;">
<button class="btn btn-danger btn-sm" style="margin: 5px 10px;">
<span _ngcontent-cml-8="" class="fa fa-remove"></span>
</button>
<button class="btn btn-success btn-sm" style="margin: 5px 10px;">
<span _ngcontent-cml-8="" class="fa fa-check"></span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-9 full-height overlay-col" style="overflow-y: scroll;">
Expand Down
5 changes: 3 additions & 2 deletions src/server/services/ytapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ export class YTAPI {
let song_collate = 'INSERT INTO `videos` (`videoID`, `Title`, `Poster`, `Thumbnails`, `FormattedTime`, `Duration`) VALUES ' + this.db.escape(nestedlists) + ' ON DUPLICATE KEY UPDATE `videoID`=`videoID`;';
this.db.query(song_collate)
.subscribe(
_ => _,
_ => {
return callback(null, full_list);
},
err => console.error(err)
);
return callback(null, full_list);
}

}

0 comments on commit 02b2288

Please sign in to comment.