Skip to content

Commit

Permalink
Merge branch 'rigrassm-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailbot committed Mar 23, 2016
2 parents 77e99d9 + 817cd8f commit 912961c
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 157 deletions.
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ lokenx:sickragewrapper
lokenx:sonarrwrapper
meteorhacks:npm
davidyaha:collection2-migrations
rigrassm:tvmaze
1 change: 1 addition & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
rigrassm:[email protected]
[email protected]
[email protected]
[email protected]
Expand Down
8 changes: 7 additions & 1 deletion client/templates/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ <h1>Admin</h1>

<div class="col-md-8 settings-pane" style="display: none;" id="SettingsNotifications">
{{#autoForm collection="Settings" doc=settings id="updateNotificationsSettingsForm" type="update" resetOnSuccess="false"}}
{{> afQuickField name='pushbulletENABLED'}}
{{> afQuickField name='customNotificationTITLE' size="40"}}
<p class="text-muted"> Enter custom notification title</p>
<br>
{{> afQuickField name='customNotificationTEXT' size="40"}}
<p class="text-muted"> Enter custom notification text</p>
<br>
{{> afQuickField name='pushbulletENABLED'}}
<p class="text-muted">Enabled Pushbullet to receive alerts.</p>
<br>
{{> afQuickField name='pushbulletAPI' size="40"}}
Expand Down
12 changes: 9 additions & 3 deletions client/templates/requests/requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ <h1>Requests</h1>
<div class="request-item">
<div class="row">
<div class="col-md-2 col-md-offset-1">

{{#if searchType 'TV Shows'}}
<img src="{{poster_path}}" class="img-responsive" alt="Poster">
</div>
{{/if}}
{{#if searchType 'Movies'}}
<img src="http://image.tmdb.org/t/p/w154{{poster_path}}" class="img-responsive" alt="Poster">
{{/if}}
</div>
<div class="col-md-5">
<ul class="request-details-list">
{{#if searchType 'Movies'}}
<li><a href="http://www.dereferer.org/?http://www.imdb.com/title/{{imdb}}" target="_blank"><strong>{{title}}</strong></a></li>
<h4><li><a href="http://www.dereferer.org/?http://www.imdb.com/title/{{imdb}}" target="_blank"><strong>{{title}}</strong></a></li></h4>
{{/if}}
{{#if searchType 'TV Shows'}}
<li><a href="http://www.dereferer.org/?http://thetvdb.com/?tab=series&id={{tvdb}}" target="_blank"><strong>{{title}}</strong></a></li>
<h4> <li><a href="http://www.dereferer.org/?{{link}}" target="_blank"><strong>{{title}} ({{year}})</strong></a></li></h4>
{{/if}}
<li><strong>Release date:</strong> {{release_date}}</li>
<li><strong>Approved:</strong> {{{approval_status}}}</li>
Expand Down
10 changes: 9 additions & 1 deletion client/templates/requests/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,16 @@ Template.requests.helpers({
if ((typeof this.poster_path === 'undefined') | (this.poster_path === "/")) {
return "poster-placeholder.png";
} else {
return "https://image.tmdb.org/t/p/w154" + this.poster_path;
return this.poster_path;
}

},
'link' : function () {
var link = 'http://tvmaze.com/shows/' + this.id + '/' + this.title;
return link;
},
'year' : function () {
return moment(this.released).format('YYYY');
},
'release_date' : function () {
return moment(this.released).format('MMMM Do, YYYY');
Expand Down
7 changes: 6 additions & 1 deletion client/templates/search/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<div class="item-poster">
<div class="col-sm-3">
{{#if posterExists}}
<img src="https://image.tmdb.org/t/p/w154{{poster_path}}" class="img-responsive" alt="Poster">
{{#if isTV}}
<img src="{{poster_path}}" class="img-responsive" alt="Poster">
{{/if}}
{{#if isMovie}}
<img src="https://image.tmdb.org/t/p/w154{{poster_path}}" class="img-responsive" alt="Poster">
{{/if}}
{{/if}}
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions client/templates/search/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Template.item.helpers({
'isTV' : function () {
return this.media_type === "tv";
},
'isMovie' : function () {
return this.media_type === "movie";
},
'isRequested' : function () {
if (this.media_type === "tv") {
var doc = TV.findOne({id: this.id});
Expand Down
21 changes: 20 additions & 1 deletion lib/collections/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,26 @@ var settings = new SimpleSchema ({
defaultValue: false,
optional: true
},

customNotificationTEXT: {
type: String,
label: "Custom Notification Message",
defaultValue: "<title> requested by <user>",
optional: true
},
customNotificationTITLE: {
type: String,
label: "Custom Notification Title",
defaultValue: "Plex Requests <type>",
optional: true
},
notificationErrorTEXT: {
type: String,
defaultValue: "<title> Issues: <issue> (<user>)"
},
notificationErrorTitle: {
type: String,
defaultValue: "Plex Requests <type> Issue"
},
/**
* PUSHBULLET
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/.meteor/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

npm-container
42 changes: 41 additions & 1 deletion server/methods/admin/servicesTests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
Meteor.methods({
setTestVARS: function (t, b, request) {

var tags = {
title: "<title>",
type: "<type>",
user: "<user>",
issues: "<issues>",
release: "<year>",
link: "<link>"
};

if (request === 'test') {
var req = {
title: "A Test Movie",
type: "request",
user: "test_user",
release: "2020",
link: "https//:plex.tv"
};

} else {var req = request;}

var message_title = t.replace(tags.title, req.title);
var message_title = message_title.replace(tags.type, req.media_type);
var message_title = message_title.replace(tags.user, req.user);
var message_title = message_title.replace(tags.issues, req.issues);
var message_title = message_title.replace(tags.release, req.release);
var message_title = message_title.replace(tags.link, req.link);

var message_body = b.replace(tags.title, req.title);
var message_body = message_body.replace(tags.type, req.media_type);
var message_body = message_body.replace(tags.user, req.user);
var message_body = message_body.replace(tags.issues, req.issues);
var message_body = message_body.replace(tags.release, req.release);
var message_body = message_body.replace(tags.link, req.link);

var r = {title: message_title, body: message_body}
return r
},
testCouchPotato: function () {
return CouchPotato.appAvailable();
},
Expand All @@ -11,7 +50,8 @@ Meteor.methods({
testPushbulllet: function () {
var settings = Settings.find().fetch()[0];
try {
Meteor.call("sendPushbulletNotification", settings, 'Plex Requests', 'Test notification!');
var message = Meteor.call("setTestVARS", settings.customNotificationTITLE, settings.customNotificationTEXT, request = 'test');
Meteor.call("sendPushbulletNotification", settings, message.title, message.body);
logger.info("Pushbullet tested successfully");
} catch (error) {
throw new Meteor.Error(401, error);
Expand Down
2 changes: 1 addition & 1 deletion server/methods/admin/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Meteor.methods({
return "master";
},
getVersion: function () {
return "1.7.4";
return "1.8.1";
},
checkForUpdate : function () {
var branch = Meteor.call('getBranch');
Expand Down
Loading

0 comments on commit 912961c

Please sign in to comment.