2
* Copyright (C) 2013 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
import Ubuntu.Components 0.1
20
import "../../Components"
26
property alias ready: nfo.ready
27
readonly property url fileUri: item ? item.fileUri : ""
31
source: item ? item.nfoUri : ""
34
title: nfo.ready ? nfo.video.title : ""
35
url: item ? item.nfoUri.replace(/\.nfo$/, "-fanart.jpg") : ""
36
previewWidthRatio: 0.6
37
playable: fileUri != ""
39
onPreviewImageClicked: {
41
shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', root.fileUri);
48
property int buttonWidth: Math.min(units.gu(22), (width - spacing) / 2)
50
width: parent.buttonWidth
52
text: nfo.ready && nfo.video.buyPrice != "" ? "Buy for " + nfo.video.buyPrice : ""
54
iconSource: "graphics/icon_button_amazon.png"
58
width: parent.buttonWidth
60
text: nfo.ready && nfo.video.buyPrice != "" ? "Rent for " + nfo.video.rentPrice : ""
62
iconSource: "graphics/icon_button_u1.png"
70
maximumRating: 10 // FIXME: this should happen on the backend side
71
rating: nfo.ready ? nfo.video.rating: 0
75
text: nfo.ready ? nfo.video.plot : ""
80
wrapMode: Text.WordWrap
89
property int firstColWidth: units.gu(9)
90
property int secondColWidth: width - firstColWidth - spacing
92
visible: directedLabel.visible
96
horizontalAlignment: Text.AlignRight
97
width: parent.firstColWidth
108
width: parent.secondColWidth
109
text: nfo.ready ? nfo.video.director : ""
112
wrapMode: Text.WordWrap
115
visible: starringLabel.visible
118
horizontalAlignment: Text.AlignRight
120
width: parent.firstColWidth
131
width: parent.secondColWidth
132
text: nfo.ready ? nfo.getActors().join(", ") : ""
133
wrapMode: Text.WordWrap
138
visible: authorLabel.visible
141
horizontalAlignment: Text.AlignRight
143
width: parent.firstColWidth
154
width: parent.secondColWidth
155
text: nfo.ready ? nfo.video.author : ""
156
wrapMode: Text.WordWrap
169
if (nfo.video.year) parts.push(nfo.video.year)
170
if (nfo.video.runtime) parts.push("%1 minutes".arg(nfo.video.runtime))
172
return parts.join(", ");