Skip to content

Commit

Permalink
0.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jez500 committed May 18, 2014
1 parent 6361b5a commit 94e575e
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 941 deletions.
2 changes: 1 addition & 1 deletion dist/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="webinterface.chorus"
version="0.3.8"
version="0.3.9"
name="Chorus"
provider-name="jez500">
<requires>
Expand Down
14 changes: 14 additions & 0 deletions dist/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Version 0.3.9
- changed search trigger to only respond to input change #39 - thanks to kopf
- Strip [color] text from labels #33 - thanks to thorstenhirsch
- Fix for iOS bug in footer #40 - thanks to joshjowen
- Add iOS icon #47 - thanks to joshjowen
- Add Android icon
- Fixed bug where movies reloaded complete list when you get to the end #35
- Improved now playing meta info in footer
- Fixed LiveTV now playing information #38
- Added duration and direct download link to movie view
- Added duration and direct download link to tv episode view, moved plot into overview tab
- Fixed bug with closing the remote (having to click button twice)


Version 0.3.8
- Fixed ability to delete a custom playlist song
- Refactored player state and added some improvements to stream playback
Expand Down
86 changes: 61 additions & 25 deletions dist/chorus.js
Original file line number Diff line number Diff line change
Expand Up @@ -15983,8 +15983,10 @@ app.Router = Backbone.Router.extend({
// fetch results
app.cached.movieCollection.fetch({"fullRange": fullRange, "success": function(collection){

// if fully loaded, we don't want a next button
collection.showNext = !app.cached.movieCollection.fullyLoaded;

// get the view of results
collection.showNext = true;
app.cached.movieListView = new app.MovieListView({model: collection});

if(isNewPage === true || app.moviePageNum === 0 || append !== true){ // Replace content //
Expand Down Expand Up @@ -17566,9 +17568,39 @@ app.ui = {
app.ui.timerStart();
}

},


}
/**
* Create a sub-title string for a given model
*/
getModelMeta: function(model){

// need a model or type to continue
if(model === undefined || model.type === undefined){
return '';
}

// meta depends on type
meta = '';
switch(model.type){
case 'song':
meta = app.helpers.parseArtistsArray(model);
break;
case 'movie':
meta = model.year;
break;
case 'episode':
meta = model.showtitle + ' (S' + model.season + ' E' + model.episode + ')';
break;
case 'channel':
meta = model.title;
break;
}

// return the meta
return meta;
}



Expand Down Expand Up @@ -17756,7 +17788,7 @@ app.PvrChannel = Backbone.Model.extend({
app.Movie = Backbone.Model.extend({

initialize:function () {},
defaults: {movieid: 1, thumbnail: '', fanart: '', year: '', url: '#movies', 'thumbsup': false, 'libraryId': 1},
defaults: {movieid: 1, thumbnail: '', fanart: '', year: '', url: '#movies', 'thumbsup': false, 'libraryId': 1, runtime: 0},

sync: function(method, model, options) {
if (method === "read") {
Expand All @@ -17782,7 +17814,7 @@ app.Movie = Backbone.Model.extend({
app.TVShow = Backbone.Model.extend({

initialize:function () {},
defaults: {'tvshowid': '', 'label': '', 'watchedepisodes': '', 'genre': '', 'year': '', 'cast': [], 'rating': 0, url: '#tv', 'episodeid': ''},
defaults: {'tvshowid': '', 'label': '', 'watchedepisodes': '', 'genre': '', 'year': '', 'cast': [], 'rating': 0, url: '#tv', 'episodeid': '', runtime: 0},

sync: function(method, model, options) {
if (method === "read") {
Expand Down Expand Up @@ -22188,13 +22220,10 @@ app.MovieCollection = Backbone.Collection.extend({
sync: function(method, model, options) {
if (method === "read") {


// Get a paginated
var self = this,
fullRange = (typeof options.fullRange != 'undefined' && options.fullRange === true);



// load up a full cache for pagination
app.cached.moviesPage = new app.MovieAllCollection();
app.cached.moviesPage.fetch({"success": function(model){
Expand All @@ -22203,7 +22232,8 @@ app.MovieCollection = Backbone.Collection.extend({
// return pagination from cache if exists
var cache = self.cachedPagination(app.moviePageNum, fullRange);
if(cache !== false){
options.success(cache);
self.fullyLoaded = (cache >= app.stores.allMovies.length);
options.success(cache);
return;
}

Expand Down Expand Up @@ -22232,28 +22262,21 @@ app.MovieCollection = Backbone.Collection.extend({
});
}

// if models less than ipp then must be the end
if(data.models.length > app.itemsPerPage){
self.fullyLoaded = true;
}
// if models less than ipp or we have a complete collection then must be the end
self.fullyLoaded = (data.models.length < app.itemsPerPage || data.models.length >= app.stores.allMovies.length);

// return callback
options.success(data.models);
return data.models;
}});




}});

//return this

}
},




/**
* Returns a set of results if in cache or false if a lookup is required
* @param pageNum
Expand Down Expand Up @@ -25474,8 +25497,11 @@ app.MovieListView = Backbone.View.extend({
},

nextPage: function(e){
var $el = $('.next-page').last();
app.pager.nextPage($el, 'movie');
// Do not run if we have no next button (sometime sneaks past even if button not rendered somehow?)
if(this.model.showNext !== undefined && this.model.showNext === true){
var $el = $('.next-page').last();
app.pager.nextPage($el, 'movie');
}
},


Expand Down Expand Up @@ -25679,9 +25705,14 @@ app.MovieView = Backbone.View.extend({
model.thumbsup = app.playlists.isThumbsUp('movie', model.movieid);
model.watched = app.VideoController.watchedStatus(model);

//main detail
// main detail
this.$el.html(this.template(model));

// populate download link
app.AudioController.downloadFile(model.file, function(url){
$('.download-link', this.$el).attr('href', url);
});

// backstretch
_.defer(function(){
var $fart = $('#fanart-background',self.$el),
Expand Down Expand Up @@ -26299,7 +26330,7 @@ app.playerStateView = Backbone.View.extend({
* @returns {boolean}
*/
isUrl: function(str){
return (str.lastIndexOf("http://", 0) === 0) || (str.lastIndexOf("https://", 0) === 0);
return str !== undefined && ((str.lastIndexOf("http://", 0) === 0) || (str.lastIndexOf("https://", 0) === 0));
},


Expand Down Expand Up @@ -26353,7 +26384,7 @@ app.playerStateView = Backbone.View.extend({
cur = 0,
dur = 0,
// playlist stuff
meta = app.helpers.parseArtistsArray(data.item),
meta = app.ui.getModelMeta(data.item),
$playlistActive = $('.playlist .playing-row');

//set playlist meta and playing row
Expand Down Expand Up @@ -27584,7 +27615,7 @@ app.searchView = Backbone.View.extend({
var keyDelay = 200, self = this;

// set and clear timeout to leave a gap
$('#search').keyup(function (e) {
$('#search').on('input', function (e) {
// e.preventDefault();
clearTimeout(app.cached.keyupTimeout); // doesn't matter if it's 0
app.cached.keyupTimeout = setTimeout(function(){
Expand Down Expand Up @@ -27664,8 +27695,8 @@ app.searchView = Backbone.View.extend({

// toggle remote
remoteControl: function(e){
e.preventDefault();
if(app.helpers.arg(0) == 'remote'){
e.preventDefault();
// same as using the back button
window.history.back();
} else {
Expand Down Expand Up @@ -28486,6 +28517,11 @@ app.TvshowView = Backbone.View.extend({
//main detail
this.$el.html(this.template(model));

// populate download link
app.AudioController.downloadFile(model.file, function(url){
$('.download-link', this.$el).attr('href', url);
});

// backstretch
_.defer(function(){
var $fart = $('#fanart-background',this.$el),
Expand Down
20 changes: 10 additions & 10 deletions dist/chorus.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 94e575e

Please sign in to comment.