Browse Source

Trailer detail

pull/5180/head
Ruud 10 years ago
parent
commit
19fa94bc44
  1. 12
      couchpotato/core/media/movie/_base/static/details.js
  2. 92
      couchpotato/core/media/movie/_base/static/movie.actions.js
  3. 16
      couchpotato/core/media/movie/_base/static/movie.js
  4. 73
      couchpotato/core/media/movie/_base/static/movie.scss
  5. 2
      couchpotato/core/media/movie/_base/static/wanted.js
  6. 4
      couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js
  7. 36
      couchpotato/static/fonts/config.json
  8. BIN
      couchpotato/static/fonts/icons.eot
  9. 8
      couchpotato/static/fonts/icons.svg
  10. BIN
      couchpotato/static/fonts/icons.ttf
  11. BIN
      couchpotato/static/fonts/icons.woff
  12. 16
      couchpotato/static/style/fonts.scss

12
couchpotato/core/media/movie/_base/static/details.js

@ -3,6 +3,7 @@ var MovieDetails = new Class({
Extends: BlockBase,
sections: null,
buttons: null,
initialize: function(parent, options){
var self = this;
@ -19,10 +20,11 @@ var MovieDetails = new Class({
}).grab(
new Element('a.close.icon-left-arrow')
),
self.content = new Element('div.content').grab(
self.content = new Element('div.content').adopt(
new Element('h1', {
'text': parent.getTitle() + (parent.get('year') ? ' (' + parent.get('year') + ')' : '')
})
}),
self.buttons = new Element('div.buttons')
)
);
@ -43,6 +45,12 @@ var MovieDetails = new Class({
);
},
addButton: function(button){
var self = this;
self.buttons.grab(button);
},
close: function(){
var self = this;

92
couchpotato/core/media/movie/_base/static/movie.actions.js

@ -151,7 +151,8 @@ MA.Release = new Class({
new Element('span.size', {'text': 'Size'}),
new Element('span.age', {'text': 'Age'}),
new Element('span.score', {'text': 'Score'}),
new Element('span.provider', {'text': 'Provider'})
new Element('span.provider', {'text': 'Provider'}),
new Element('span.actions')
).inject(self.release_container);
if(self.movie.data.releases)
@ -185,27 +186,33 @@ MA.Release = new Class({
new Element('span.age', {'text': self.get(release, 'age')}),
new Element('span.score', {'text': self.get(release, 'score')}),
new Element('span.provider', { 'text': provider, 'title': provider }),
info.detail_url ? new Element('a.info.icon2', {
'href': info.detail_url,
'target': '_blank'
}) : new Element('a'),
new Element('a.download.icon2', {
'events': {
'click': function(e){
(e).preventDefault();
if(!this.hasClass('completed'))
self.download(release);
new Element('span.actions').adopt(
info.detail_url ? new Element('a.icon-info', {
'href': info.detail_url,
'target': '_blank'
}) : new Element('a'),
new Element('a.icon-download', {
'events': {
'click': function(e){
(e).preventDefault();
if(!this.hasClass('completed'))
self.download(release);
}
}
}
}),
new Element('a.delete.icon2', {
'events': {
'click': function(e){
(e).preventDefault();
self.ignore(release);
}),
new Element('a', {
'class': release.status == 'ignored' ? 'icon-redo' : 'icon-cancel',
'events': {
'click': function(e){
(e).preventDefault();
self.ignore(release);
this.toggleClass('icon-redo');
this.toggleClass('icon-cancel');
}
}
}
})
})
)
).inject(self.release_container);
if(release.status == 'ignored' || release.status == 'failed' || release.status == 'snatched'){
@ -224,9 +231,12 @@ MA.Release = new Class({
release.el.set('class', 'item ' + new_status);
var status_el = release.el.getElement('.release_status');
status_el.set('class', 'release_status ' + new_status);
status_el.set('text', new_status);
release.el.getElement(':last-child')
.set('class', notification.data.status == 'ignored' ? 'icon-redo' : 'icon-cancel');
var status_el = release.el.getElement('.status');
status_el.set('class', 'status ' + new_status);
status_el.set('text', new_status);
if(!q && (new_status == 'snatched' || new_status == 'seeding' || new_status == 'done'))
q = self.addQuality(release.quality_id);
@ -317,13 +327,13 @@ MA.Release = new Class({
self.trynext_container = new Element('div.buttons.trynext').inject(self.movie.info_container);
self.trynext_container.adopt(
has_available ? [new Element('a.icon2.readd', {
has_available ? [new Element('a.icon-redo', {
'text': has_snatched ? 'Download another release' : 'Download the best release',
'events': {
'click': self.tryNextRelease.bind(self)
}
}),
new Element('a.icon2.download', {
new Element('a.icon-download', {
'text': 'pick one yourself',
'events': {
'click': function(){
@ -331,7 +341,7 @@ MA.Release = new Class({
}
}
})] : null,
new Element('a.icon2.completed', {
new Element('a.icon-ok', {
'text': 'mark this movie done',
'events': {
'click': self.markMovieDone.bind(self)
@ -350,7 +360,7 @@ MA.Release = new Class({
var self = this;
var release_el = self.release_container.getElement('#release_'+release._id),
icon = release_el.getElement('.download.icon2');
icon = release_el.getElement('.icon-download');
if(icon)
icon.addClass('icon spinner').removeClass('download');
@ -442,13 +452,7 @@ MA.Trailer = new Class({
.grab(self.player_container);
}
return self.player_container;
},
watch: function(){
var self = this;
var data_url = 'https://www.googleapis.com/youtube/v3/search?q="{title}" {year} trailer&maxResults=1&type=video&videoDefinition=high&videoEmbeddable=true&part=snippet&key=AIzaSyAT3li1KjfLidaL6Vt8T92MRU7n4VOrjYk'
var data_url = 'https://www.googleapis.com/youtube/v3/search?q="{title}" {year} trailer&maxResults=1&type=video&videoDefinition=high&videoEmbeddable=true&part=snippet&key=AIzaSyAT3li1KjfLidaL6Vt8T92MRU7n4VOrjYk';
var url = data_url.substitute({
'title': encodeURI(self.getTitle()),
'year': self.get('year')
@ -459,31 +463,17 @@ MA.Trailer = new Class({
'onComplete': function(json){
self.player = new YT.Player(id, {
'height': height,
'width': size.x,
'height': '100%',
'width': '100%',
'videoId': json.items[0].id.videoId,
'playerVars': {
'autoplay': 1,
'showsearch': 0,
'showinfo': 0,
'wmode': 'transparent',
'iv_load_policy': 3
}
});
var quality_set = false;
var change_quality = function(state){
if(!quality_set && (state.data == 1 || state.data || 2)){
try {
self.player.setPlaybackQuality('hd720');
quality_set = true;
}
catch(e){
}
}
};
self.player.addEventListener('onStateChange', change_quality);
}
}).send();

16
couchpotato/core/media/movie/_base/static/movie.js

@ -25,9 +25,6 @@ var Movie = new Class({
self.parent(self, options);
self.addEvents();
if(data.identifiers.imdb == 'tt1228705')
self.openDetails();
},
openDetails: function(){
@ -41,8 +38,15 @@ var Movie = new Class({
// Add action items
self.actions.each(function(action, nr){
var details = action.getDetails();
if(details)
if(details){
self.details.addSection(action.getLabel(), details);
}
else {
var button = action.getButton();
if(button){
//self.details.addButton(button.clone(true).cloneEvents(button));
}
}
});
}
@ -252,8 +256,8 @@ var Movie = new Class({
// Add releases
self.updateReleases();
self.options.actions.each(function(action){
var action = new action(self),
self.options.actions.each(function(a){
var action = new a(self),
button = action.getButton();
if(button)
self.actions_el.grab(button);

73
couchpotato/core/media/movie/_base/static/movie.scss

@ -73,6 +73,7 @@
float: left;
margin-bottom: $padding;
position: relative;
cursor: pointer;
&:nth-child(4n+4){
@include span(last);
@ -203,6 +204,7 @@
background: $background_color;
z-index: 200;
border-radius: 3px 0 0 3px;
overflow-y: auto;
h1 {
margin: 0;
@ -225,24 +227,77 @@
margin-bottom: $padding/2;
}
.item span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
}
.item {
&:not(.head):hover {
background: $theme_off;
}
span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
padding: $padding/3 0;
}
.name {
@include flex(1 auto);
text-align: left;
}
&.ignored {
span:not(.actions) {
opacity: .3;
}
.name {
text-decoration: line-through;
}
}
.item .name {
@include flex(1 auto);
text-align: left;
.actions {
padding: 0;
a {
display: inline-block;
vertical-align: top;
padding: $padding/3;
min-width: 26px;
color: $text_color;
cursor: pointer;
&:hover {
color: $primary_color;
}
}
}
}
.status { min-width: 70px; max-width: 70px; }
.quality { min-width: 60px; max-width: 60px; }
.size { min-width: 40px; max-width: 40px; }
.age { min-width: 40px; max-width: 40px; }
.score { min-width: 45px; max-width: 45px; }
.provider { min-width: 110px; max-width: 110px; }
.actions { min-width: 80px; max-width: 80px; }
}
.trailer_container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
max-width: 100%;
iframe, object, embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}

2
couchpotato/core/media/movie/_base/static/wanted.js

@ -32,7 +32,7 @@ var MoviesWanted = new Class({
self.list = new MovieList({
'identifier': 'wanted',
'status': 'active',
'actions': [MA.IMDB, MA.Trailer, MA.Release, MA.Edit, MA.Refresh, MA.Readd, MA.Delete],
'actions': [MA.IMDB, MA.Release, MA.Trailer, MA.Edit, MA.Refresh, MA.Readd, MA.Delete],
'add_new': true,
'menu': [self.manual_search, self.scan_folder],
'on_empty_element': App.createUserscriptButtons().addClass('empty_wanted')

4
couchpotato/core/media/movie/providers/automation/trakt/static/trakt.js

@ -17,7 +17,7 @@ var TraktAutomation = new Class({
var trakt_set = 0;
fieldset.getElements('input[type=text]').each(function(el){
trakt_set += +(el.get('value') != '');
trakt_set += +(el.get('value') !== '');
});
new Element('.ctrlHolder').adopt(
@ -58,7 +58,7 @@ var TraktAutomation = new Class({
})
).inject(fieldset);
})
});
}

36
couchpotato/static/fonts/config.json

@ -43,12 +43,48 @@
"src": "fontawesome"
},
{
"uid": "12f4ece88e46abd864e40b35e05b11cd",
"css": "ok",
"code": 59408,
"src": "fontawesome"
},
{
"uid": "5211af474d3a9848f67f945e2ccaf143",
"css": "cancel",
"code": 59406,
"src": "fontawesome"
},
{
"uid": "3d4ea8a78dc34efe891f3a0f3d961274",
"css": "info",
"code": 59403,
"src": "fontawesome"
},
{
"uid": "9a76bc135eac17d2c8b8ad4a5774fc87",
"css": "download",
"code": 59404,
"src": "fontawesome"
},
{
"uid": "f48ae54adfb27d8ada53d0fd9e34ee10",
"css": "delete",
"code": 59405,
"src": "fontawesome"
},
{
"uid": "e99461abfef3923546da8d745372c995",
"css": "settings",
"code": 59393,
"src": "fontawesome"
},
{
"uid": "bc71f4c6e53394d5ba46b063040014f1",
"css": "redo",
"code": 59407,
"src": "fontawesome"
},
{
"uid": "4109c474ff99cad28fd5a2c38af2ec6f",
"css": "filter",
"code": 59396,

BIN
couchpotato/static/fonts/icons.eot

Binary file not shown.

8
couchpotato/static/fonts/icons.svg

@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<metadata>Copyright (C) 2015 by original authors @ fontello.com</metadata>
<defs>
<font id="icons" horiz-adv-x="1000" >
<font-face font-family="icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
@ -17,6 +17,12 @@
<glyph glyph-name="emo-cry" unicode="&#xe808;" d="m278 787c-7 0-15-2-23-5l-128-62-80-38c-2-1-4-2-6-3-1-5-1-11-1-16l0 0 0-1 0 0c0-69 40-162 122-163l0 0 0 0 0 0c34 1 65 19 87 50 26 35 37 82 34 128l18 8c27 13 38 45 25 71-9 19-28 31-48 31z m212 0c-20 0-39-11-48-30-13-27-1-59 25-71l18-9c-3-46 9-93 34-128 22-31 53-49 87-49l0 0 1 0 0 0c82 0 121 93 122 162l0 0 0 1 0 0c0 5-1 11-1 16-2 1-5 2-7 3l-80 38-128 62c-7 3-15 5-23 5z m279-302c-7 0-15-5-21-16-42-72-96-259 27-259 123 1 73 182 16 261-6 8-14 13-22 14z m-512-138c-57 0-112-9-166-26-10-4-20-7-30-11-11-5-21-9-30-13l0 0-1-1 0 0c-26-12-37-44-25-70 13-26 44-38 70-25l0-1c9 5 17 8 24 11 9 3 17 6 25 9 43 14 88 21 133 21 51 0 101-9 148-27 19-7 37-15 55-24 91-49 163-130 200-232 10-27 40-41 68-31 27 10 42 40 32 68-46 126-137 227-250 288-22 12-45 22-69 31-57 21-120 33-184 33z" horiz-adv-x="851" />
<glyph glyph-name="emo-coffee" unicode="&#xe809;" d="m1234 850c-17 0-34-8-44-23-54-80-24-144 4-204 13-29 26-56 5-72-23-17-28-51-10-74 17-23 51-28 74-10 89 67 60 131 27 201-15 33-32 70-12 99 16 25 10 57-14 74-9 6-20 9-30 9z m-1021-121c-81 0-157-39-203-105-18-25-12-59 14-77 24-17 59-11 76 14 45 63 132 76 193 32l0 0c3-2 7-6 11-9l1-1 1-1c3-3 7-7 10-10l1-2 0 0 0 0 1-1 1 0c20-23 55-25 78-4 22 20 24 55 4 77-46 55-116 87-188 87z m499 0c-80 0-156-39-202-105-18-25-12-59 13-77 25-17 59-11 77 14 44 63 131 76 192 32l0 0c4-2 8-6 12-9l0-1 1-1c4-3 7-7 11-10l1-2 0 0 0 0 1-1 0 0c20-23 55-25 78-4 23 20 25 55 4 77-46 55-116 87-188 87z m206-346c-24 0-44-19-44-43l1-4-1-275 0 0 0 0 0 0c0-58 24-111 62-149l0 0 0 0 0 0c38-38 91-62 148-62l0 0 226 0c1 0 3 0 5 0 13 1 27 2 39 5 15 4 29 8 42 14 55 26 97 74 114 133l31 0 0 0c37 0 70 15 94 39 23 23 38 56 38 92l0 0 0 0 0 119 0 0c0 36-15 69-39 93l0 0c-23 23-56 38-92 38l0 0 0 0-624 0z m604-100c11 0 21-5 28-12l1 0 0 0c7-8 12-18 12-29l0 0 0-110 0 0c0-11-5-21-12-29-8-7-18-12-29-12l0 0-62 0 0 0c-21 0-39-16-40-37-4-41-31-76-67-93-7-3-15-6-22-8-7-1-14-2-21-2l-3 0-209 0 0-1c-30 1-59 13-79 34l-1 0c-21 21-34 50-34 81l0 0 0 0 0 0 1 218 537 0 0 0z m-82-55l0-96 32 0c22 0 39 17 39 38l0 20c0 21-17 38-39 38l-32 0z m-1131-12c-30 0-55-25-55-55s25-55 55-55l297 0c30 0 54 25 54 55s-24 55-54 55l-297 0z" horiz-adv-x="1673" />
<glyph glyph-name="emo-sunglasses" unicode="&#xe80a;" d="m495 745c-154 0-309 0-463 0-18 0-32-15-32-33 3-153 129-306 278-309 84-2 164 36 218 95 55-59 135-97 219-95 149 3 272 156 275 309 0 18-14 33-32 33-155 0-309 0-463 0z m319-510c-18 0-35-9-45-25l0 0c0-1-1-2-1-3-7-12-15-23-24-34-10-12-19-23-29-32-54-51-126-80-203-80l0 0 0 0c-21 0-43 2-64 7-3 0-6 1-10 2-17 5-34 11-51 19-26 12-58 1-70-26-13-27-1-58 25-71 22-10 45-18 69-24 5-1 9-2 14-4 29-6 58-9 87-9l0 0 0 0c104 0 201 39 275 108 15 14 28 29 40 43 11 15 22 31 32 48 0 0 1 1 1 1 15 25 7 58-18 73-9 5-18 7-28 7z" horiz-adv-x="990" />
<glyph glyph-name="info" unicode="&#xe80b;" d="m357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
<glyph glyph-name="download" unicode="&#xe80c;" d="m714 100q0 15-10 25t-25 11-26-11-10-25 10-25 26-11 25 11 10 25z m143 0q0 15-10 25t-26 11-25-11-10-25 10-25 25-11 26 11 10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-40l-250-250q-10-10-25-10t-25 10l-250 250q-17 17-8 40 10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
<glyph glyph-name="delete" unicode="&#xe80d;" d="m286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q22 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
<glyph glyph-name="cancel" unicode="&#xe80e;" d="m724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
<glyph glyph-name="redo" unicode="&#xe80f;" d="m857 707v-250q0-14-10-25t-26-11h-250q-23 0-32 23-10 22 7 38l77 77q-82 77-194 77-58 0-111-23t-91-61-62-91-22-111 22-111 62-91 91-61 111-23q66 0 125 29t100 82q4 6 13 7 8 0 14-5l76-77q5-4 6-11t-5-13q-60-74-147-114t-182-41q-87 0-167 34t-136 92-92 137-34 166 34 166 92 137 136 92 167 34q82 0 158-31t137-88l72 72q16 18 39 8 22-9 22-33z" horiz-adv-x="857.1" />
<glyph glyph-name="ok" unicode="&#xe810;" d="m932 534q0-22-15-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q15-16 15-38z" horiz-adv-x="1000" />
</font>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
couchpotato/static/fonts/icons.ttf

Binary file not shown.

BIN
couchpotato/static/fonts/icons.woff

Binary file not shown.

16
couchpotato/static/style/fonts.scss

@ -1,11 +1,11 @@
/* Fonts */
@font-face {
font-family: 'icons';
src: url('../fonts/icons.eot?74719534');
src: url('../fonts/icons.eot?74719534#iefix') format('embedded-opentype'),
url('../fonts/icons.woff?74719534') format('woff'),
url('../fonts/icons.ttf?74719534') format('truetype'),
url('../fonts/icons.svg?74719534#icons') format('svg');
src: url('../fonts/icons.eot?74719538');
src: url('../fonts/icons.eot?74719538#iefix') format('embedded-opentype'),
url('../fonts/icons.woff?74719538') format('woff'),
url('../fonts/icons.ttf?74719538') format('truetype'),
url('../fonts/icons.svg?74719538#icons') format('svg');
font-weight: normal;
font-style: normal;
}
@ -30,6 +30,12 @@
.icon-emo-cry:before { content: '\e808'; }
.icon-emo-coffee:before { content: '\e809'; }
.icon-emo-sunglasses:before { content: '\e80a'; }
.icon-info:before { content: '\e80b'; }
.icon-download:before { content: '\e80c'; }
.icon-delete:before { content: '\e80d'; }
.icon-cancel:before { content: '\e80e'; }
.icon-redo:before { content: '\e80f'; }
.icon-ok:before { content: '\e810'; }
@font-face {
font-family: 'OpenSans';

Loading…
Cancel
Save