Refactoring: move all apps inside a sub folder
This commit is contained in:
1 parent
33e4fe0c4e
commit
b1ca2a7cff
41 files changed
+54
-45
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Bouton navigable à la télécommande : surbrillance blanche quand il a le focus.
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property alias text: label.text
|
||||
property bool primary: false
|
||||
signal clicked()
|
||||
|
||||
implicitWidth: Math.max(160, label.implicitWidth + Theme.spacingL * 2)
|
||||
implicitHeight: Theme.controlHeight
|
||||
radius: Theme.radius
|
||||
opacity: enabled ? 1 : 0.5
|
||||
color: activeFocus ? Theme.focusBackground : (primary ? Theme.accent : Theme.surface)
|
||||
scale: activeFocus ? 1.05 : 1
|
||||
|
||||
Behavior on scale { NumberAnimation { duration: Theme.animFast } }
|
||||
Behavior on color { ColorAnimation { duration: Theme.animFast } }
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
color: root.activeFocus ? Theme.textOnFocus : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: root.activeFocus
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key)) {
|
||||
event.accepted = true;
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
|
||||
// Souris : pratique pour tester hors de la box.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.enabled
|
||||
onClicked: {
|
||||
root.forceActiveFocus();
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Panneau de gauche avec le logo, affiché sur tous les écrans de connexion.
|
||||
Rectangle {
|
||||
color: Theme.panel
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "../icon.png"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Carte du catalogue : image (affiche ou vignette), titre, sous-titre, avancement.
|
||||
Item {
|
||||
id: card
|
||||
|
||||
property string title: ""
|
||||
property string subtitle: ""
|
||||
property url imageSource: ""
|
||||
property int imageHeight: Theme.posterHeight
|
||||
property real progress: 0
|
||||
property bool played: false
|
||||
property bool highlighted: false
|
||||
property bool showText: true
|
||||
signal clicked()
|
||||
|
||||
height: imageHeight + (showText ? Theme.cardTextHeight : 0)
|
||||
z: highlighted ? 1 : 0
|
||||
|
||||
Rectangle {
|
||||
id: frame
|
||||
width: parent.width
|
||||
height: card.imageHeight
|
||||
radius: Theme.radius
|
||||
color: Theme.surface
|
||||
border.width: card.highlighted ? 3 : 0
|
||||
border.color: Theme.focusBackground
|
||||
scale: card.highlighted ? 1.06 : 1
|
||||
|
||||
Behavior on scale { NumberAnimation { duration: Theme.animFast } }
|
||||
|
||||
// Initiale tant que l'image n'est pas chargée (ou absente).
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: image.status !== Image.Ready
|
||||
text: card.title.charAt(0).toUpperCase()
|
||||
color: Theme.textMuted
|
||||
font.pixelSize: 48
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
anchors.fill: parent
|
||||
anchors.margins: frame.border.width
|
||||
source: card.imageSource
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
clip: true
|
||||
sourceSize.height: card.imageHeight
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: card.progress > 0.01 && !card.played
|
||||
anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: 8 }
|
||||
height: 4
|
||||
radius: 2
|
||||
color: "#99000000"
|
||||
|
||||
Rectangle {
|
||||
width: parent.width * Math.min(1, card.progress)
|
||||
height: parent.height
|
||||
radius: 2
|
||||
color: Theme.accent
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: card.played
|
||||
anchors { top: parent.top; right: parent.right; margins: 8 }
|
||||
width: playedText.implicitWidth + Theme.spacingS * 2
|
||||
height: playedText.implicitHeight + 4
|
||||
radius: height / 2
|
||||
color: Theme.accent
|
||||
|
||||
Text {
|
||||
id: playedText
|
||||
anchors.centerIn: parent
|
||||
text: "VU"
|
||||
color: Theme.text
|
||||
font.pixelSize: 11
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
visible: card.showText
|
||||
anchors { top: frame.bottom; topMargin: Theme.spacingS; left: parent.left; right: parent.right }
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: card.title
|
||||
elide: Text.ElideRight
|
||||
color: card.highlighted ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall + 1
|
||||
font.bold: card.highlighted
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
text: card.subtitle
|
||||
elide: Text.ElideRight
|
||||
color: Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall - 1
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: card.clicked()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
import "../Shared/Format.js" as Format
|
||||
|
||||
// Rangée horizontale de cartes avec un titre (accueil, saisons…).
|
||||
// `items` : éléments aplatis par Session._toItem().
|
||||
FocusScope {
|
||||
id: row
|
||||
|
||||
property string title: ""
|
||||
property var items: []
|
||||
property bool landscape: false
|
||||
property var session: null
|
||||
property alias currentIndex: list.currentIndex
|
||||
signal activated(var item)
|
||||
|
||||
readonly property int cardWidth: landscape ? Theme.thumbWidth : Theme.posterWidth
|
||||
readonly property int imageHeight: landscape ? Theme.thumbHeight : Theme.posterHeight
|
||||
|
||||
height: titleText.height + Theme.spacingM + imageHeight + Theme.cardTextHeight + Theme.spacingM
|
||||
|
||||
Text {
|
||||
id: titleText
|
||||
text: row.title
|
||||
color: row.activeFocus ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: list
|
||||
anchors {
|
||||
top: titleText.bottom
|
||||
topMargin: Theme.spacingM
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
orientation: ListView.Horizontal
|
||||
spacing: Theme.spacingM
|
||||
focus: true
|
||||
// Marge pour la carte agrandie (scale) au bord gauche.
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
highlightMoveDuration: 150
|
||||
model: row.items
|
||||
|
||||
delegate: MediaCard {
|
||||
width: row.cardWidth
|
||||
imageHeight: row.imageHeight
|
||||
title: Format.cardTitle(modelData)
|
||||
subtitle: Format.cardSubtitle(modelData)
|
||||
imageSource: !row.session ? ""
|
||||
: row.landscape ? row.session.thumbUrl(modelData)
|
||||
: row.session.posterUrl(modelData)
|
||||
progress: Format.progress(modelData)
|
||||
played: modelData.played
|
||||
highlighted: ListView.isCurrentItem && list.activeFocus
|
||||
onClicked: {
|
||||
list.currentIndex = index;
|
||||
row.activated(modelData);
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
row.activated(row.items[currentIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Base de chaque écran : en-tête (titre + sous-titre) et zone de contenu.
|
||||
// `navigator` et `session` sont injectés par le Navigator au chargement.
|
||||
FocusScope {
|
||||
id: page
|
||||
|
||||
property var navigator: null
|
||||
property var session: null
|
||||
// Élément qui reçoit le focus quand l'écran s'affiche.
|
||||
property Item initialFocus: null
|
||||
// true : masque le panneau du logo (écrans du catalogue).
|
||||
property bool fullscreen: false
|
||||
// Image de fond facultative (assombrie).
|
||||
property alias backdrop: backdropImage.source
|
||||
|
||||
property alias title: titleText.text
|
||||
property alias subtitle: subtitleText.text
|
||||
default property alias content: body.data
|
||||
|
||||
Image {
|
||||
id: backdropImage
|
||||
anchors.fill: parent
|
||||
visible: status === Image.Ready
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
opacity: 0.25
|
||||
}
|
||||
|
||||
Column {
|
||||
id: header
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: Theme.pageMargin
|
||||
}
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Text {
|
||||
id: titleText
|
||||
width: parent.width
|
||||
color: Theme.text
|
||||
font.pixelSize: Theme.fontTitle
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
id: subtitleText
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
color: Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: body
|
||||
anchors {
|
||||
top: header.bottom
|
||||
topMargin: Theme.spacingXL
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
leftMargin: Theme.pageMargin
|
||||
rightMargin: Theme.pageMargin
|
||||
bottomMargin: Theme.pageMargin
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Ligne de la liste des serveurs.
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property string name: ""
|
||||
property string address: ""
|
||||
property bool highlighted: false
|
||||
signal clicked()
|
||||
|
||||
height: 72
|
||||
radius: Theme.radius
|
||||
color: highlighted ? Theme.focusBackground : Theme.surface
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animFast } }
|
||||
|
||||
Rectangle {
|
||||
id: icon
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: Theme.spacingM
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
width: 40
|
||||
height: 40
|
||||
radius: width / 2
|
||||
color: Theme.avatarColor(root.name)
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: root.name.charAt(0).toUpperCase()
|
||||
color: Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: icon.right
|
||||
leftMargin: Theme.spacingM
|
||||
right: parent.right
|
||||
rightMargin: Theme.spacingM
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: root.name
|
||||
color: root.highlighted ? Theme.textOnFocus : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: root.address
|
||||
color: root.highlighted ? Theme.textOnFocusMuted : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Champ de saisie avec libellé. Haut/Bas ne sont pas consommés par le TextInput
|
||||
// et remontent donc jusqu'au KeyNavigation posé sur ce composant.
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
property alias label: labelText.text
|
||||
property alias text: input.text
|
||||
property alias placeholder: placeholderText.text
|
||||
property bool password: false
|
||||
// Ex. Qt.ImhDigitsOnly pour demander un clavier numérique (si le système le gère).
|
||||
property alias inputMethodHints: input.inputMethodHints
|
||||
property alias validator: input.validator
|
||||
property alias maximumLength: input.maximumLength
|
||||
signal accepted()
|
||||
|
||||
implicitWidth: 400
|
||||
implicitHeight: column.implicitHeight
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: input.forceActiveFocus()
|
||||
}
|
||||
|
||||
Column {
|
||||
id: column
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Text {
|
||||
id: labelText
|
||||
visible: text !== ""
|
||||
color: root.activeFocus ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: Theme.controlHeight
|
||||
radius: Theme.radius
|
||||
color: Theme.surface
|
||||
border.width: 2
|
||||
border.color: root.activeFocus ? Theme.accent : Theme.border
|
||||
|
||||
TextInput {
|
||||
id: input
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: Theme.spacingM
|
||||
rightMargin: Theme.spacingM
|
||||
}
|
||||
focus: true
|
||||
clip: true
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
color: Theme.text
|
||||
selectionColor: Theme.accent
|
||||
font.pixelSize: Theme.fontBody
|
||||
echoMode: root.password ? TextInput.Password : TextInput.Normal
|
||||
onAccepted: root.accepted()
|
||||
}
|
||||
|
||||
Text {
|
||||
id: placeholderText
|
||||
anchors.fill: input
|
||||
visible: input.text === ""
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: Theme.textMuted
|
||||
font: input.font
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Carte utilisateur (avatar rond + nom). `addCard` affiche la carte « Ajouter un compte ».
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string name: ""
|
||||
property bool addCard: false
|
||||
property bool highlighted: false
|
||||
signal clicked()
|
||||
|
||||
width: 140
|
||||
height: 200
|
||||
|
||||
Rectangle {
|
||||
id: avatar
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: Theme.spacingS
|
||||
width: 120
|
||||
height: 120
|
||||
radius: width / 2
|
||||
color: root.addCard ? Theme.surface : Theme.avatarColor(root.name)
|
||||
border.width: root.highlighted ? 4 : 0
|
||||
border.color: Theme.focusBackground
|
||||
scale: root.highlighted ? 1.1 : 1
|
||||
|
||||
Behavior on scale { NumberAnimation { duration: Theme.animFast } }
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: root.addCard ? "+" : root.name.charAt(0).toUpperCase()
|
||||
color: Theme.text
|
||||
font.pixelSize: 48
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
top: avatar.bottom
|
||||
topMargin: Theme.spacingL
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
text: root.name
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 2
|
||||
elide: Text.ElideRight
|
||||
color: root.highlighted ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: root.highlighted
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
import QtQuick 2.5
|
||||
|
||||
// Surface vidéo avec une interface unique, quel que soit le lecteur disponible :
|
||||
// - "fbx" : VideoPlayer de libfbxqml (fbx.media) — absent du Freebox Player testé,
|
||||
// conservé en premier choix au cas où, mais jamais vérifié ;
|
||||
// - "qtmultimedia" : Video de QtMultimedia — c'est lui qui lit sur la box (HLS, reprise,
|
||||
// pause et déplacement vérifiés ; positions en millisecondes).
|
||||
// Les deux sont créés dynamiquement : un module absent ne fait pas échouer le chargement.
|
||||
//
|
||||
// position / duration en millisecondes ; playerState : "idle", "loading", "playing",
|
||||
// "paused", "ended" ou "error". Les états bruts du lecteur sont écrits dans le log.
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string source: ""
|
||||
property real position: 0
|
||||
property real duration: 0
|
||||
property string playerState: "idle"
|
||||
property string errorString: ""
|
||||
property string backendName: ""
|
||||
signal ended()
|
||||
|
||||
property var _backend: null
|
||||
property string _lastRaw: ""
|
||||
|
||||
function play() {
|
||||
if (_backend)
|
||||
_backend.play();
|
||||
}
|
||||
|
||||
function pause() {
|
||||
if (_backend)
|
||||
_backend.pause();
|
||||
}
|
||||
|
||||
function togglePause() {
|
||||
if (playerState === "playing")
|
||||
pause();
|
||||
else
|
||||
play();
|
||||
}
|
||||
|
||||
function seek(ms) {
|
||||
if (!_backend)
|
||||
return;
|
||||
var target = Math.max(0, duration > 0 ? Math.min(ms, duration - 1000) : ms);
|
||||
console.log("Lecteur : déplacement à " + Math.round(target / 1000) + " s");
|
||||
_backend.seek(target);
|
||||
}
|
||||
|
||||
function stop() {
|
||||
if (!_backend)
|
||||
return;
|
||||
_backend.stop();
|
||||
if (backendName === "fbx" && _backend.close)
|
||||
_backend.close();
|
||||
}
|
||||
|
||||
function _create() {
|
||||
var attempts = [
|
||||
{ name: "fbx", qml: 'import QtQuick 2.5; import fbx.media 1.0; VideoPlayer { anchors.fill: parent }' },
|
||||
{ name: "qtmultimedia", qml: 'import QtQuick 2.5; import QtMultimedia 5.0; '
|
||||
+ 'Video { anchors.fill: parent; fillMode: VideoOutput.PreserveAspectFit }' }
|
||||
];
|
||||
for (var i = 0; i < attempts.length && !_backend; i++) {
|
||||
try {
|
||||
_backend = Qt.createQmlObject(attempts[i].qml, root, "VideoSurface-" + attempts[i].name);
|
||||
backendName = attempts[i].name;
|
||||
} catch (e) {
|
||||
console.log("Lecteur " + attempts[i].name + " indisponible : " + e);
|
||||
}
|
||||
}
|
||||
if (!_backend) {
|
||||
_fail("Aucun lecteur vidéo disponible.");
|
||||
return;
|
||||
}
|
||||
console.log("Lecteur vidéo : " + backendName);
|
||||
if (backendName === "fbx" && _backend.error) {
|
||||
_backend.error.connect(function (message, fatal) {
|
||||
console.log("Lecteur fbx : erreur " + message + (fatal ? " (fatale)" : ""));
|
||||
if (fatal)
|
||||
_fail(String(message));
|
||||
});
|
||||
}
|
||||
if (source !== "")
|
||||
_open();
|
||||
}
|
||||
|
||||
function _open() {
|
||||
errorString = "";
|
||||
playerState = "loading";
|
||||
_backend.source = source;
|
||||
_backend.play();
|
||||
}
|
||||
|
||||
function _fail(message) {
|
||||
errorString = message;
|
||||
playerState = "error";
|
||||
}
|
||||
|
||||
// Lecture périodique de l'état du lecteur (identique pour les deux backends).
|
||||
function _poll() {
|
||||
if (!_backend || playerState === "error")
|
||||
return;
|
||||
var raw;
|
||||
if (backendName === "fbx") {
|
||||
raw = "mediaState=" + _backend.mediaState + " playbackState=" + _backend.playbackState
|
||||
+ " status=" + _backend.status;
|
||||
position = _backend.position || 0;
|
||||
duration = _backend.duration || 0;
|
||||
var media = String(_backend.mediaState);
|
||||
var playback = String(_backend.playbackState);
|
||||
if (media === "ended")
|
||||
_setState("ended");
|
||||
else if (playback === "playing")
|
||||
_setState("playing");
|
||||
else if (playback === "paused")
|
||||
_setState("paused");
|
||||
else
|
||||
_setState("loading");
|
||||
} else {
|
||||
// Valeurs de MediaPlayer : playbackState 1 = lecture, 2 = pause ;
|
||||
// status 7 = fin du média, 8 = média invalide.
|
||||
raw = "status=" + _backend.status + " playbackState=" + _backend.playbackState;
|
||||
position = _backend.position || 0;
|
||||
duration = _backend.duration > 0 ? _backend.duration : 0;
|
||||
if (_backend.status === 8 || (_backend.errorString && _backend.error !== 0))
|
||||
_fail(_backend.errorString || "Média illisible.");
|
||||
else if (_backend.status === 7)
|
||||
_setState("ended");
|
||||
else if (_backend.playbackState === 1)
|
||||
_setState(_backend.status === 4 || _backend.status === 5 ? "loading" : "playing");
|
||||
else if (_backend.playbackState === 2)
|
||||
_setState("paused");
|
||||
}
|
||||
if (raw !== _lastRaw) {
|
||||
_lastRaw = raw;
|
||||
console.log("Lecteur " + backendName + " : " + raw + " position=" + Math.round(position)
|
||||
+ " durée=" + Math.round(duration));
|
||||
}
|
||||
}
|
||||
|
||||
function _setState(state) {
|
||||
if (state === playerState)
|
||||
return;
|
||||
playerState = state;
|
||||
if (state === "ended")
|
||||
ended();
|
||||
}
|
||||
|
||||
onSourceChanged: if (_backend && source !== "") _open()
|
||||
|
||||
Timer {
|
||||
interval: 250
|
||||
repeat: true
|
||||
running: root._backend !== null && root.source !== ""
|
||||
onTriggered: root._poll()
|
||||
}
|
||||
|
||||
Component.onCompleted: _create()
|
||||
Component.onDestruction: stop()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
Page 1.0 Page.qml
|
||||
FocusButton 1.0 FocusButton.qml
|
||||
TextField 1.0 TextField.qml
|
||||
ServerItem 1.0 ServerItem.qml
|
||||
UserCard 1.0 UserCard.qml
|
||||
Logo 1.0 Logo.qml
|
||||
MediaCard 1.0 MediaCard.qml
|
||||
MediaRow 1.0 MediaRow.qml
|
||||
VideoSurface 1.0 VideoSurface.qml
|
||||
@@ -0,0 +1,44 @@
|
||||
.pragma library
|
||||
|
||||
// Ce que le Freebox Player (Revolution) sait lire, déclaré à Jellyfin dans PlaybackInfo.
|
||||
// Jellyfin choisit alors : lecture directe si le fichier convient, sinon transcodage HLS.
|
||||
// Hypothèses prudentes (H.264 seulement : pas de HEVC sur la Revolution), à ajuster
|
||||
// d'après les essais sur la box.
|
||||
|
||||
var maxBitrate = 20000000;
|
||||
|
||||
function profile() {
|
||||
return {
|
||||
Name: "Freebox Player",
|
||||
MaxStreamingBitrate: maxBitrate,
|
||||
MaxStaticBitrate: maxBitrate,
|
||||
DirectPlayProfiles: [
|
||||
{ Type: "Video", Container: "mp4,m4v,mkv,ts,mov", VideoCodec: "h264", AudioCodec: "aac,mp3,ac3" }
|
||||
],
|
||||
TranscodingProfiles: [
|
||||
{
|
||||
Type: "Video", Container: "ts", Protocol: "hls", Context: "Streaming",
|
||||
VideoCodec: "h264", AudioCodec: "aac,ac3", MaxAudioChannels: "6",
|
||||
MinSegments: 1, BreakOnNonKeyFrames: true
|
||||
}
|
||||
],
|
||||
CodecProfiles: [
|
||||
{
|
||||
Type: "Video", Codec: "h264",
|
||||
Conditions: [
|
||||
{ Condition: "LessThanEqual", Property: "Width", Value: "1920" },
|
||||
{ Condition: "LessThanEqual", Property: "VideoBitDepth", Value: "8" }
|
||||
]
|
||||
}
|
||||
],
|
||||
// Sous-titres texte déclarés « externes » : sans ça, Jellyfin transcode pour les
|
||||
// incruster (SubtitleCodecNotSupported). Le lecteur ne les affiche pas encore.
|
||||
SubtitleProfiles: [
|
||||
{ Format: "srt", Method: "External" },
|
||||
{ Format: "subrip", Method: "External" },
|
||||
{ Format: "ass", Method: "External" },
|
||||
{ Format: "ssa", Method: "External" },
|
||||
{ Format: "vtt", Method: "External" }
|
||||
]
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Pile de navigation entre les écrans de Views/.
|
||||
// push("ServerAdd") charge Views/ServerAddView.qml ; la touche Retour dépile.
|
||||
// Chaque écran reçoit `navigator` et `session`, plus les propriétés passées à push().
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
property var session: null
|
||||
property int depth: 0
|
||||
readonly property bool fullscreen: loader.item !== null && loader.item.fullscreen === true
|
||||
property var _stack: []
|
||||
|
||||
function push(name, props) {
|
||||
_stack.push({ name: name, props: props || {} });
|
||||
_load();
|
||||
}
|
||||
|
||||
function replace(name, props) {
|
||||
if (_stack.length > 0)
|
||||
_stack.pop();
|
||||
push(name, props);
|
||||
}
|
||||
|
||||
function pop() {
|
||||
if (_stack.length <= 1)
|
||||
return false;
|
||||
_stack.pop();
|
||||
_load();
|
||||
return true;
|
||||
}
|
||||
|
||||
function reset(name, props) {
|
||||
_stack = [];
|
||||
push(name, props);
|
||||
}
|
||||
|
||||
// Ouvre l'écran adapté à un élément du catalogue (Session._toItem()).
|
||||
function openItem(item) {
|
||||
if (item.type === "CollectionFolder")
|
||||
push("Library", { library: { id: item.id, name: item.name, collectionType: item.collectionType } });
|
||||
else if (item.type === "Season")
|
||||
push("Season", { seriesId: item.seriesId, seasonId: item.id, seasonName: item.name,
|
||||
seriesName: item.seriesName });
|
||||
else
|
||||
push("Details", { itemId: item.id });
|
||||
}
|
||||
|
||||
function _load() {
|
||||
var entry = _stack[_stack.length - 1];
|
||||
var props = { navigator: root, session: root.session };
|
||||
for (var key in entry.props)
|
||||
props[key] = entry.props[key];
|
||||
depth = _stack.length;
|
||||
loader.setSource(Qt.resolvedUrl("../Views/" + entry.name + "View.qml"), props);
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
|
||||
onLoaded: {
|
||||
fadeIn.restart();
|
||||
var target = item.initialFocus ? item.initialFocus : item;
|
||||
target.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
id: fadeIn
|
||||
target: loader.item
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 180
|
||||
}
|
||||
|
||||
// Retour : on dépile ; à la racine, la touche remonte (fermeture de l'app).
|
||||
Keys.onPressed: {
|
||||
if (Remote.isBack(event.key) && pop())
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,633 @@
|
||||
import QtQuick 2.5
|
||||
import fbx.application 1.0
|
||||
import "DeviceProfile.js" as DeviceProfile
|
||||
|
||||
// État de connexion et appels à l'API Jellyfin : serveurs enregistrés,
|
||||
// serveur et utilisateur courants, jeton d'accès.
|
||||
// Les fonctions asynchrones appellent `callback(erreur, résultat)` ; `erreur` est un
|
||||
// message prêt à afficher. cancel() ignore les réponses encore en attente.
|
||||
QtObject {
|
||||
id: session
|
||||
|
||||
readonly property string clientName: "Jellyfin Freebox"
|
||||
// Doit rester égale à « version » dans manifest.json (vérifié par freebox-jellyfin package).
|
||||
readonly property string clientVersion: "0.1.0"
|
||||
readonly property string deviceName: "Freebox Player"
|
||||
|
||||
// Serveurs enregistrés : { name, address, id }
|
||||
property ListModel servers: ListModel {}
|
||||
|
||||
property var currentServer: null // { name, address, id }
|
||||
property var currentUser: null // { name, id }
|
||||
property string accessToken: ""
|
||||
// Comptes de test fournis par freebox-jellyfin deploy --user : { name, password? }
|
||||
property var devUsers: []
|
||||
|
||||
// ---------------------------------------------------------------- Serveurs
|
||||
|
||||
function selectServer(index) {
|
||||
var server = servers.get(index);
|
||||
currentServer = { name: server.name, address: server.address, id: server.id };
|
||||
}
|
||||
|
||||
function removeServer(index) {
|
||||
servers.remove(index);
|
||||
_saveServers();
|
||||
}
|
||||
|
||||
// Ajoute (ou met à jour) un serveur à partir de l'hôte saisi et d'un port facultatif.
|
||||
// Le clavier de la box n'a ni « : » ni « / » : le protocole et le port sont
|
||||
// détectés en essayant chaque adresse de serverCandidates() dans l'ordre.
|
||||
function connectToServer(host, port, callback) {
|
||||
callback = _guard(callback);
|
||||
_addServer(host, port, function (err) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
selectServer(0);
|
||||
callback(null, currentServer);
|
||||
});
|
||||
}
|
||||
|
||||
// Ajoute le serveur en tête de liste (sans le sélectionner) ; non lié à cancel().
|
||||
function _addServer(host, port, callback) {
|
||||
if ((host || "").trim() === "") {
|
||||
callback("Veuillez saisir l'adresse du serveur.");
|
||||
return;
|
||||
}
|
||||
var portText = (port || "").trim();
|
||||
if (portText !== "" && !isValidPort(portText)) {
|
||||
callback("Le port doit être un nombre entre 1 et 65535.");
|
||||
return;
|
||||
}
|
||||
_probeCandidates(serverCandidates(host, portText), function (err, server) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
var index = _indexOfServer(server.id);
|
||||
if (index >= 0)
|
||||
servers.remove(index);
|
||||
servers.insert(0, server);
|
||||
_saveServers();
|
||||
callback(null, server);
|
||||
});
|
||||
}
|
||||
|
||||
// Test sur la box : freebox-jellyfin deploy --server <adresse> --user <nom[:mdp]> sert
|
||||
// dev-config.json à côté de l'app ; chaque serveur listé est ajouté et les comptes
|
||||
// sont proposés sur « Qui regarde ? ». Absent (404) hors test : rien ne se passe.
|
||||
function loadDevConfig(url) {
|
||||
if (!/^https?:/i.test(url))
|
||||
return; // app chargée depuis le disque (aperçu PC) : pas de dev-config
|
||||
_request("GET", "", null, function (err, config) {
|
||||
if (err || !config)
|
||||
return;
|
||||
if (config.users && config.users.length > 0) {
|
||||
devUsers = config.users;
|
||||
console.log("dev-config : " + config.users.length + " utilisateur(s) de test");
|
||||
}
|
||||
var hosts = config.servers || [];
|
||||
for (var i = 0; i < hosts.length; i++) {
|
||||
(function (host) {
|
||||
_addServer(host, "", function (err2, server) {
|
||||
console.log(err2 ? "dev-config : " + host + " → " + err2
|
||||
: "dev-config : serveur ajouté " + server.address);
|
||||
});
|
||||
})(String(hosts[i]));
|
||||
}
|
||||
}, { baseUrl: url, timeout: 3000 });
|
||||
}
|
||||
|
||||
// Adresses à essayer, de la plus probable à la moins probable
|
||||
// (même logique que les clients Jellyfin officiels).
|
||||
function serverCandidates(host, port) {
|
||||
var text = (host || "").trim().replace(/\/+$/, "");
|
||||
if (text === "")
|
||||
return [];
|
||||
// Adresse complète (saisie depuis un clavier qui a « : ») : utilisée telle quelle.
|
||||
if (/^https?:\/\//i.test(text)) {
|
||||
if (port && !/:\d+$/.test(text.replace(/^https?:\/\//i, "")))
|
||||
text += ":" + port;
|
||||
return [text];
|
||||
}
|
||||
if (port)
|
||||
return ["https://" + text + ":" + port, "http://" + text + ":" + port];
|
||||
// Port déjà inclus dans l'hôte (ex. 192.168.1.20:8096).
|
||||
if (/:\d+$/.test(text))
|
||||
return ["https://" + text, "http://" + text];
|
||||
return [
|
||||
"https://" + text,
|
||||
"http://" + text + ":8096",
|
||||
"https://" + text + ":8920",
|
||||
"http://" + text
|
||||
];
|
||||
}
|
||||
|
||||
function isValidPort(text) {
|
||||
if (!/^\d+$/.test(text))
|
||||
return false;
|
||||
var value = parseInt(text, 10);
|
||||
return value >= 1 && value <= 65535;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------ Utilisateurs
|
||||
|
||||
// Comptes affichés sur l'écran de connexion du serveur (peut être vide).
|
||||
function loadPublicUsers(callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/Users/Public", null, function (err, data) {
|
||||
if (err) {
|
||||
callback(_describe(err));
|
||||
return;
|
||||
}
|
||||
var users = [];
|
||||
for (var i = 0; i < (data || []).length; i++)
|
||||
users.push({ name: data[i].Name, id: data[i].Id, hasPassword: data[i].HasPassword });
|
||||
callback(null, users);
|
||||
});
|
||||
}
|
||||
|
||||
function authenticate(username, password, callback) {
|
||||
callback = _guard(callback);
|
||||
var name = (username || "").trim();
|
||||
if (name === "") {
|
||||
callback("Veuillez saisir votre nom d'utilisateur.");
|
||||
return;
|
||||
}
|
||||
_request("POST", "/Users/AuthenticateByName", { Username: name, Pw: password || "" }, function (err, data) {
|
||||
if (err) {
|
||||
callback(err.status === 401 ? "Nom d'utilisateur ou mot de passe incorrect." : _describe(err));
|
||||
return;
|
||||
}
|
||||
callback(null, _signedIn(data));
|
||||
});
|
||||
}
|
||||
|
||||
function logout() {
|
||||
if (accessToken !== "")
|
||||
_request("POST", "/Sessions/Logout", null, function () {});
|
||||
accessToken = "";
|
||||
currentUser = null;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------- Quick Connect
|
||||
|
||||
function isQuickConnectEnabled(callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/QuickConnect/Enabled", null, function (err, data) {
|
||||
callback(null, !err && data === true);
|
||||
});
|
||||
}
|
||||
|
||||
// onCode(erreur, code) : code à afficher ; onSignedIn(erreur, utilisateur) : autorisation reçue.
|
||||
function startQuickConnect(onCode, onSignedIn) {
|
||||
stopQuickConnect();
|
||||
onCode = _guard(onCode);
|
||||
_quickConnect.onSignedIn = _guard(onSignedIn);
|
||||
_request("POST", "/QuickConnect/Initiate", null, function (err, data) {
|
||||
if (err || !data || !data.Secret) {
|
||||
onCode(err && err.status === 401
|
||||
? "Quick Connect est désactivé sur ce serveur."
|
||||
: _describe(err || { kind: "invalid" }));
|
||||
return;
|
||||
}
|
||||
_quickConnect.secret = data.Secret;
|
||||
_quickConnectPoll.start();
|
||||
onCode(null, data.Code);
|
||||
});
|
||||
}
|
||||
|
||||
function stopQuickConnect() {
|
||||
_quickConnectPoll.stop();
|
||||
_quickConnect.secret = "";
|
||||
}
|
||||
|
||||
property var _quickConnect: ({ secret: "", onSignedIn: null })
|
||||
property Timer _quickConnectPoll: Timer {
|
||||
interval: 5000
|
||||
repeat: true
|
||||
onTriggered: session._pollQuickConnect()
|
||||
}
|
||||
|
||||
function _pollQuickConnect() {
|
||||
var secret = _quickConnect.secret;
|
||||
if (secret === "")
|
||||
return;
|
||||
_request("GET", "/QuickConnect/Connect?Secret=" + encodeURIComponent(secret), null, function (err, data) {
|
||||
if (secret !== _quickConnect.secret || err || !data || !data.Authenticated)
|
||||
return;
|
||||
stopQuickConnect();
|
||||
_request("POST", "/Users/AuthenticateWithQuickConnect", { Secret: secret }, function (err2, auth) {
|
||||
var done = _quickConnect.onSignedIn;
|
||||
if (!done)
|
||||
return;
|
||||
if (err2)
|
||||
done(_describe(err2));
|
||||
else
|
||||
done(null, _signedIn(auth));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------- Catalogue
|
||||
// Les éléments renvoyés sont « aplatis » par _toItem() (voir ses champs) pour
|
||||
// pouvoir aller tels quels dans un ListModel ou un modèle JS.
|
||||
|
||||
// Bibliothèques de l'utilisateur : Films, Séries…
|
||||
function loadLibraries(callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/UserViews?" + _query({ userId: currentUser.id }), null, function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? [] : _toItems(data.Items));
|
||||
});
|
||||
}
|
||||
|
||||
// « Reprendre » : vidéos commencées.
|
||||
function loadResume(callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/UserItems/Resume?" + _query({
|
||||
userId: currentUser.id, limit: 20, mediaTypes: "Video", enableTotalRecordCount: false
|
||||
}), null, function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? [] : _toItems(data.Items));
|
||||
});
|
||||
}
|
||||
|
||||
// Derniers ajouts d'une bibliothèque.
|
||||
function loadLatest(libraryId, callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/Items/Latest?" + _query({ userId: currentUser.id, parentId: libraryId, limit: 20 }),
|
||||
null, function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? [] : _toItems(data));
|
||||
});
|
||||
}
|
||||
|
||||
// Contenu d'une bibliothèque, par pages. callback(err, items, total)
|
||||
function loadLibraryItems(library, startIndex, limit, callback) {
|
||||
callback = _guard(callback);
|
||||
var types = library.collectionType === "tvshows" ? "Series"
|
||||
: library.collectionType === "movies" ? "Movie" : "Movie,Series,Video";
|
||||
_request("GET", "/Items?" + _query({
|
||||
userId: currentUser.id, parentId: library.id, recursive: true, includeItemTypes: types,
|
||||
sortBy: "SortName", sortOrder: "Ascending", startIndex: startIndex, limit: limit,
|
||||
fields: "PrimaryImageAspectRatio"
|
||||
}), null, function (err, data) {
|
||||
if (err)
|
||||
callback(_describe(err), [], 0);
|
||||
else
|
||||
callback(null, _toItems(data.Items), data.TotalRecordCount || 0);
|
||||
});
|
||||
}
|
||||
|
||||
function loadItem(itemId, callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/Items/" + itemId + "?" + _query({ userId: currentUser.id }), null, function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? null : _toItem(data));
|
||||
});
|
||||
}
|
||||
|
||||
function loadSeasons(seriesId, callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/Shows/" + seriesId + "/Seasons?" + _query({ userId: currentUser.id }), null,
|
||||
function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? [] : _toItems(data.Items));
|
||||
});
|
||||
}
|
||||
|
||||
function loadEpisodes(seriesId, seasonId, callback) {
|
||||
callback = _guard(callback);
|
||||
_request("GET", "/Shows/" + seriesId + "/Episodes?" + _query({
|
||||
userId: currentUser.id, seasonId: seasonId, fields: "Overview"
|
||||
}), null, function (err, data) {
|
||||
callback(err ? _describe(err) : null, err ? [] : _toItems(data.Items));
|
||||
});
|
||||
}
|
||||
|
||||
// URL d'image (pas d'authentification nécessaire). kind : "Primary", "Backdrop", "Thumb".
|
||||
function imageUrl(itemId, kind, tag, maxHeight) {
|
||||
if (!currentServer || !itemId || !tag)
|
||||
return "";
|
||||
return currentServer.address + "/Items/" + itemId + "/Images/" + kind + "?"
|
||||
+ _query({ tag: tag, maxHeight: maxHeight || 360, quality: 90 });
|
||||
}
|
||||
|
||||
// Affiche : celle de l'élément, sinon celle de sa série.
|
||||
function posterUrl(item, maxHeight) {
|
||||
if (item.imageTag)
|
||||
return imageUrl(item.id, "Primary", item.imageTag, maxHeight);
|
||||
return imageUrl(item.seriesId, "Primary", item.seriesPrimaryTag, maxHeight);
|
||||
}
|
||||
|
||||
// Vignette 16:9 : image principale des bibliothèques/épisodes, sinon Thumb, sinon fond.
|
||||
function thumbUrl(item, maxHeight) {
|
||||
maxHeight = maxHeight || 300;
|
||||
if ((item.type === "CollectionFolder" || item.type === "Episode") && item.imageTag)
|
||||
return imageUrl(item.id, "Primary", item.imageTag, maxHeight);
|
||||
if (item.thumbTag)
|
||||
return imageUrl(item.id, "Thumb", item.thumbTag, maxHeight);
|
||||
return backdropUrl(item, maxHeight) || posterUrl(item, maxHeight);
|
||||
}
|
||||
|
||||
function backdropUrl(item, maxHeight) {
|
||||
if (item.backdropTag)
|
||||
return imageUrl(item.id, "Backdrop", item.backdropTag, maxHeight || 720);
|
||||
return imageUrl(item.parentBackdropItemId, "Backdrop", item.parentBackdropTag, maxHeight || 720);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------- Lecture
|
||||
|
||||
// Demande à Jellyfin comment lire l'élément pour ce Player (profil DeviceProfile.js).
|
||||
// callback(err, { url, itemId, mediaSourceId, playSessionId, playMethod })
|
||||
function preparePlayback(itemId, callback) {
|
||||
callback = _guard(callback);
|
||||
_request("POST", "/Items/" + itemId + "/PlaybackInfo?" + _query({ userId: currentUser.id }),
|
||||
// SubtitleStreamIndex -1 : pas de sous-titres (évite leur incrustation par transcodage).
|
||||
{ DeviceProfile: DeviceProfile.profile(), MaxStreamingBitrate: DeviceProfile.maxBitrate,
|
||||
SubtitleStreamIndex: -1 },
|
||||
function (err, data) {
|
||||
if (err) {
|
||||
callback(_describe(err));
|
||||
return;
|
||||
}
|
||||
var source = data.MediaSources && data.MediaSources[0];
|
||||
if (data.ErrorCode || !source) {
|
||||
callback("Lecture impossible (" + (data.ErrorCode || "aucune source") + ").");
|
||||
return;
|
||||
}
|
||||
var info = { itemId: itemId, mediaSourceId: source.Id, playSessionId: data.PlaySessionId };
|
||||
if (source.SupportsDirectPlay || source.SupportsDirectStream) {
|
||||
info.playMethod = source.SupportsDirectPlay ? "DirectPlay" : "DirectStream";
|
||||
info.url = currentServer.address + "/Videos/" + itemId + "/stream?" + _query({
|
||||
static: true, mediaSourceId: source.Id, playSessionId: data.PlaySessionId,
|
||||
deviceId: _settings.deviceId, api_key: accessToken
|
||||
});
|
||||
} else if (source.SupportsTranscoding && source.TranscodingUrl) {
|
||||
info.playMethod = "Transcode";
|
||||
info.url = currentServer.address + source.TranscodingUrl;
|
||||
} else {
|
||||
callback("Ce média ne peut pas être lu sur la Freebox.");
|
||||
return;
|
||||
}
|
||||
console.log("Lecture : " + info.playMethod + " (" + (source.Container || "?") + ")");
|
||||
callback(null, info);
|
||||
});
|
||||
}
|
||||
|
||||
// Suivi de lecture côté serveur (reprise, « vu »). event : "start", "progress", "stop".
|
||||
function reportPlayback(event, info, positionMs, paused) {
|
||||
var path = event === "start" ? "/Sessions/Playing"
|
||||
: event === "stop" ? "/Sessions/Playing/Stopped" : "/Sessions/Playing/Progress";
|
||||
_request("POST", path, {
|
||||
ItemId: info.itemId, MediaSourceId: info.mediaSourceId, PlaySessionId: info.playSessionId,
|
||||
PlayMethod: info.playMethod, PositionTicks: Math.floor((positionMs || 0) * 10000),
|
||||
IsPaused: !!paused, CanSeek: true
|
||||
}, function () {});
|
||||
}
|
||||
|
||||
function _query(params) {
|
||||
var parts = [];
|
||||
for (var key in params) {
|
||||
if (params[key] !== undefined && params[key] !== null && params[key] !== "")
|
||||
parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(params[key]));
|
||||
}
|
||||
return parts.join("&");
|
||||
}
|
||||
|
||||
function _toItems(list) {
|
||||
var items = [];
|
||||
for (var i = 0; i < (list || []).length; i++)
|
||||
items.push(_toItem(list[i]));
|
||||
return items;
|
||||
}
|
||||
|
||||
function _toItem(i) {
|
||||
var userData = i.UserData || {};
|
||||
return {
|
||||
id: i.Id,
|
||||
name: i.Name || "",
|
||||
type: i.Type || "",
|
||||
collectionType: i.CollectionType || "",
|
||||
isFolder: !!i.IsFolder,
|
||||
year: i.ProductionYear || 0,
|
||||
overview: i.Overview || "",
|
||||
runtimeTicks: i.RunTimeTicks || 0,
|
||||
rating: i.OfficialRating || "",
|
||||
communityRating: i.CommunityRating || 0,
|
||||
imageTag: (i.ImageTags && i.ImageTags.Primary) || "",
|
||||
thumbTag: (i.ImageTags && i.ImageTags.Thumb) || "",
|
||||
backdropTag: (i.BackdropImageTags && i.BackdropImageTags[0]) || "",
|
||||
parentBackdropItemId: i.ParentBackdropItemId || "",
|
||||
parentBackdropTag: (i.ParentBackdropImageTags && i.ParentBackdropImageTags[0]) || "",
|
||||
seriesId: i.SeriesId || "",
|
||||
seriesName: i.SeriesName || "",
|
||||
seriesPrimaryTag: i.SeriesPrimaryImageTag || "",
|
||||
seasonId: i.SeasonId || "",
|
||||
// (pas de champ « index » : rôle réservé dans les ListModel)
|
||||
indexNumber: i.IndexNumber || 0,
|
||||
parentIndexNumber: i.ParentIndexNumber || 0,
|
||||
childCount: i.ChildCount || 0,
|
||||
positionTicks: userData.PlaybackPositionTicks || 0,
|
||||
playedPercentage: userData.PlayedPercentage || 0,
|
||||
played: !!userData.Played
|
||||
};
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------ Divers
|
||||
|
||||
// Ignore les réponses en attente (appelé quand un écran est détruit).
|
||||
function cancel() {
|
||||
_generation++;
|
||||
stopQuickConnect();
|
||||
}
|
||||
|
||||
property int _generation: 0
|
||||
|
||||
function _guard(callback) {
|
||||
var generation = _generation;
|
||||
return function () {
|
||||
if (generation === session._generation && callback)
|
||||
callback.apply(null, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
function _signedIn(data) {
|
||||
accessToken = data.AccessToken;
|
||||
currentUser = { name: data.User.Name, id: data.User.Id };
|
||||
return currentUser;
|
||||
}
|
||||
|
||||
// Essaie toutes les adresses en parallèle et retient la première, dans l'ordre de
|
||||
// priorité, qui répond comme un serveur Jellyfin. Une adresse moins prioritaire (http)
|
||||
// n'est retenue qu'une fois les plus prioritaires (https) réellement en échec : un
|
||||
// premier échange TLS lent (chargement des certificats, CPU de la box) ne doit pas
|
||||
// faire basculer sur http.
|
||||
function _probeCandidates(candidates, callback) {
|
||||
var results = [];
|
||||
var settled = false;
|
||||
|
||||
function settle() {
|
||||
if (settled)
|
||||
return;
|
||||
for (var i = 0; i < candidates.length; i++) {
|
||||
if (results[i] === undefined)
|
||||
return; // une adresse plus prioritaire n'a pas encore répondu
|
||||
if (results[i]) {
|
||||
settled = true;
|
||||
callback(null, results[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
settled = true;
|
||||
callback("Aucun serveur Jellyfin trouvé à cette adresse.");
|
||||
}
|
||||
|
||||
if (candidates.length === 0) {
|
||||
callback("Aucun serveur Jellyfin trouvé à cette adresse.");
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < candidates.length; i++) {
|
||||
(function (index, address) {
|
||||
_request("GET", "/System/Info/Public", null, function (err, info) {
|
||||
results[index] = !err && info && info.Id
|
||||
? { name: info.ServerName || _hostOf(address), address: address, id: info.Id }
|
||||
: null;
|
||||
if (!results[index])
|
||||
console.log("Serveur : " + address + " ne répond pas (" + (err ? err.kind + " " + err.status : "réponse inattendue") + ")");
|
||||
settle();
|
||||
}, { baseUrl: address, timeout: 10000 });
|
||||
})(i, candidates[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function _describe(err) {
|
||||
if (!err)
|
||||
return "";
|
||||
if (err.kind === "timeout")
|
||||
return "Le serveur ne répond pas.";
|
||||
if (err.kind === "network")
|
||||
return "Impossible de contacter le serveur.";
|
||||
if (err.kind === "invalid")
|
||||
return "Réponse inattendue du serveur.";
|
||||
return "Erreur du serveur (" + err.status + ").";
|
||||
}
|
||||
|
||||
function _authorization() {
|
||||
var value = 'MediaBrowser Client="' + clientName + '", Device="' + deviceName
|
||||
+ '", DeviceId="' + _settings.deviceId + '", Version="' + clientVersion + '"';
|
||||
if (accessToken !== "")
|
||||
value += ', Token="' + accessToken + '"';
|
||||
return value;
|
||||
}
|
||||
|
||||
// Requête JSON. callback(erreur, données) avec erreur = { kind, status } :
|
||||
// kind vaut "timeout", "network" (pas de réponse), "http" (statut != 2xx) ou "invalid".
|
||||
function _request(method, path, body, callback, options) {
|
||||
options = options || {};
|
||||
var url = (options.baseUrl || (currentServer ? currentServer.address : "")) + path;
|
||||
var xhr = new XMLHttpRequest();
|
||||
var finished = false;
|
||||
var timer = _timerComponent.createObject(session, { interval: options.timeout || 15000 });
|
||||
|
||||
function finish(err, data) {
|
||||
if (finished)
|
||||
return;
|
||||
finished = true;
|
||||
timer.stop();
|
||||
timer.destroy();
|
||||
callback(err, data);
|
||||
}
|
||||
|
||||
timer.triggered.connect(function () {
|
||||
finish({ kind: "timeout", status: 0 });
|
||||
xhr.abort();
|
||||
});
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState !== XMLHttpRequest.DONE || finished)
|
||||
return;
|
||||
if (xhr.status === 0) {
|
||||
finish({ kind: "network", status: 0 });
|
||||
} else if (xhr.status < 200 || xhr.status >= 300) {
|
||||
finish({ kind: "http", status: xhr.status });
|
||||
} else if (xhr.responseText === "") {
|
||||
finish(null, null);
|
||||
} else {
|
||||
try {
|
||||
finish(null, JSON.parse(xhr.responseText));
|
||||
} catch (e) {
|
||||
finish({ kind: "invalid", status: xhr.status });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.open(method, url);
|
||||
xhr.setRequestHeader("Authorization", _authorization());
|
||||
timer.start();
|
||||
if (body) {
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(JSON.stringify(body));
|
||||
} else {
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
|
||||
property Component _timerComponent: Component {
|
||||
Timer {}
|
||||
}
|
||||
|
||||
function _hostOf(address) {
|
||||
return address.replace(/^https?:\/\//i, "").split(/[:\/]/)[0];
|
||||
}
|
||||
|
||||
function _indexOfServer(id) {
|
||||
for (var i = 0; i < servers.count; i++) {
|
||||
if (servers.get(i).id === id)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------ Persistance
|
||||
|
||||
// Stockage de la box (fbx.application Settings) ; sans effet sur PC.
|
||||
property Settings _settings: Settings {
|
||||
property string serverList: ""
|
||||
property string deviceId: ""
|
||||
onReady: session._restore()
|
||||
}
|
||||
|
||||
function _restore() {
|
||||
if (_settings.deviceId === "")
|
||||
_settings.deviceId = _randomId();
|
||||
if (servers.count > 0)
|
||||
return;
|
||||
var list = [];
|
||||
try {
|
||||
// Encodé (voir _saveServers) ; ancien format JSON brut accepté.
|
||||
var raw = _settings.serverList;
|
||||
list = JSON.parse(raw.charAt(0) === "%" ? decodeURIComponent(raw) : (raw || "[]"));
|
||||
} catch (e) {
|
||||
}
|
||||
for (var i = 0; i < list.length; i++)
|
||||
servers.append({ name: list[i].name, address: list[i].address, id: list[i].id });
|
||||
}
|
||||
|
||||
function _saveServers() {
|
||||
var list = [];
|
||||
for (var i = 0; i < servers.count; i++) {
|
||||
var s = servers.get(i);
|
||||
list.push({ name: s.name, address: s.address, id: s.id });
|
||||
}
|
||||
// Encodé (%XX) pour n'enregistrer que des caractères simples.
|
||||
_settings.serverList = encodeURIComponent(JSON.stringify(list));
|
||||
}
|
||||
|
||||
function _randomId() {
|
||||
var id = "";
|
||||
for (var i = 0; i < 32; i++)
|
||||
id += Math.floor(Math.random() * 16).toString(16);
|
||||
return id;
|
||||
}
|
||||
|
||||
Component.onCompleted: _restore()
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
Session 1.0 Session.qml
|
||||
Navigator 1.0 Navigator.qml
|
||||
@@ -0,0 +1,27 @@
|
||||
import QmlProject 1.1
|
||||
|
||||
Project {
|
||||
mainFile: "Jellyfin.qml"
|
||||
|
||||
/* Include QML, JS, images, fonts from current directory and subdirectories */
|
||||
QmlFiles {
|
||||
directory: "."
|
||||
}
|
||||
JavaScriptFiles {
|
||||
directory: "."
|
||||
}
|
||||
ImageFiles {
|
||||
directory: "."
|
||||
}
|
||||
Files {
|
||||
filter: "qmldir;*.ttf;*.otf;*.woff"
|
||||
directory: "."
|
||||
recursive: true
|
||||
}
|
||||
Files {
|
||||
filter: "manifest.json"
|
||||
}
|
||||
|
||||
/* List of plugin directories passed to QML runtime */
|
||||
// importPaths: [ "../libfbxqml" ]
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.3.0, 2024-08-12T17:50:51. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{82daaaf9-c426-482c-8459-9906e026a767}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Freebox (192.168.0.20)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Freebox (192.168.0.20)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{2fffcf57-628c-4672-8f03-a48ccdb2ddbd}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">-1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">-1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{sourceDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">18</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">18</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
@@ -0,0 +1,47 @@
|
||||
import QtQuick 2.5
|
||||
import fbx.application 1.0
|
||||
import "Components"
|
||||
import "Shared"
|
||||
import "Core"
|
||||
|
||||
Application {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.background
|
||||
}
|
||||
|
||||
Session {
|
||||
id: appSession
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
// Masqué sur les écrans du catalogue (Page.fullscreen).
|
||||
Logo {
|
||||
id: logo
|
||||
visible: !navigator.fullscreen
|
||||
width: visible ? parent.width / 3 : 0
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
Navigator {
|
||||
id: navigator
|
||||
width: parent.width - logo.width
|
||||
height: parent.height
|
||||
session: appSession
|
||||
focus: true
|
||||
}
|
||||
}
|
||||
|
||||
// Appelée par le runtime Freebox (ouverture de l'app via une URL / un lien profond).
|
||||
// Pas encore utilisée : la déclarer évite l'avertissement au démarrage.
|
||||
function handleUrl(url) {
|
||||
console.log("handleUrl:", url);
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
navigator.push("ServerSelect");
|
||||
appSession.loadDevConfig(Qt.resolvedUrl("dev-config.json"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
.pragma library
|
||||
|
||||
// Mise en forme des durées et des libellés de médias.
|
||||
|
||||
var TICKS_PER_MS = 10000; // Jellyfin compte en « ticks » de 100 ns
|
||||
|
||||
function ticksToMs(ticks) {
|
||||
return Math.floor((ticks || 0) / TICKS_PER_MS);
|
||||
}
|
||||
|
||||
function msToTicks(ms) {
|
||||
return Math.floor((ms || 0) * TICKS_PER_MS);
|
||||
}
|
||||
|
||||
// « 1 h 34 min », « 52 min »
|
||||
function runtime(ticks) {
|
||||
var minutes = Math.round(ticksToMs(ticks) / 60000);
|
||||
if (minutes <= 0)
|
||||
return "";
|
||||
if (minutes < 60)
|
||||
return minutes + " min";
|
||||
var m = minutes % 60;
|
||||
return Math.floor(minutes / 60) + " h" + (m > 0 ? " " + (m < 10 ? "0" : "") + m + " min" : "");
|
||||
}
|
||||
|
||||
// « 1:02:03 », « 4:05 »
|
||||
function clock(ms) {
|
||||
var total = Math.max(0, Math.floor((ms || 0) / 1000));
|
||||
var h = Math.floor(total / 3600);
|
||||
var m = Math.floor((total % 3600) / 60);
|
||||
var s = total % 60;
|
||||
var mm = h > 0 && m < 10 ? "0" + m : String(m);
|
||||
return (h > 0 ? h + ":" : "") + mm + ":" + (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
|
||||
// « S1 · É3 » pour un épisode
|
||||
function episodeCode(item) {
|
||||
if (!item || item.type !== "Episode")
|
||||
return "";
|
||||
return "S" + (item.parentIndexNumber || 0) + " · É" + (item.indexNumber || 0);
|
||||
}
|
||||
|
||||
// Libellés des cartes du catalogue.
|
||||
function cardTitle(item) {
|
||||
return item.type === "Episode" && item.seriesName ? item.seriesName : item.name;
|
||||
}
|
||||
|
||||
function cardSubtitle(item) {
|
||||
if (item.type === "Episode")
|
||||
return episodeCode(item) + " – " + item.name;
|
||||
if (item.type === "Series" && item.childCount)
|
||||
return item.childCount + " saison" + (item.childCount > 1 ? "s" : "");
|
||||
return item.year ? String(item.year) : "";
|
||||
}
|
||||
|
||||
// Avancement 0..1 (pour la barre de progression des cartes).
|
||||
function progress(item) {
|
||||
if (item.playedPercentage)
|
||||
return item.playedPercentage / 100;
|
||||
return item.runtimeTicks ? item.positionTicks / item.runtimeTicks : 0;
|
||||
}
|
||||
|
||||
// Ligne d'informations : « 1997 · 1 h 34 min · Tous publics »
|
||||
function infoLine(item) {
|
||||
var parts = [];
|
||||
if (item.type === "Episode")
|
||||
parts.push(episodeCode(item));
|
||||
if (item.year)
|
||||
parts.push(String(item.year));
|
||||
if (item.runtimeTicks)
|
||||
parts.push(runtime(item.runtimeTicks));
|
||||
if (item.rating)
|
||||
parts.push(item.rating);
|
||||
if (item.communityRating)
|
||||
parts.push(item.communityRating.toFixed(1).replace(".", ",") + "/10");
|
||||
return parts.join(" · ");
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
.pragma library
|
||||
|
||||
// Correspondance des touches de la télécommande Freebox.
|
||||
// Plusieurs codes sont acceptés tant que le mapping exact sur la box n'est pas vérifié.
|
||||
|
||||
function isAccept(key) {
|
||||
return key === Qt.Key_Return || key === Qt.Key_Enter || key === Qt.Key_Select;
|
||||
}
|
||||
|
||||
function isBack(key) {
|
||||
return key === Qt.Key_Back || key === Qt.Key_Escape;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
pragma Singleton
|
||||
import QtQuick 2.5
|
||||
|
||||
// Couleurs, tailles et animations partagées par toute l'application.
|
||||
QtObject {
|
||||
// Couleurs (inspirées de la palette Jellyfin)
|
||||
readonly property color background: "#101010"
|
||||
readonly property color panel: "#000B25"
|
||||
readonly property color surface: "#202020"
|
||||
readonly property color border: "#3A3A3A"
|
||||
readonly property color focusBackground: "#FFFFFF"
|
||||
readonly property color text: "#FFFFFF"
|
||||
readonly property color textMuted: "#A0A0A0"
|
||||
readonly property color textOnFocus: "#101010"
|
||||
readonly property color textOnFocusMuted: "#505050"
|
||||
readonly property color accent: "#00A4DC"
|
||||
readonly property color accentAlt: "#AA5CC3"
|
||||
readonly property color error: "#FF5252"
|
||||
readonly property var avatarColors: ["#AA5CC3", "#00A4DC", "#E67E22", "#27AE60", "#C0392B", "#2C3E50"]
|
||||
|
||||
// Espacements
|
||||
readonly property int pageMargin: 48
|
||||
readonly property int spacingS: 8
|
||||
readonly property int spacingM: 16
|
||||
readonly property int spacingL: 24
|
||||
readonly property int spacingXL: 40
|
||||
|
||||
// Typographie
|
||||
readonly property int fontSmall: 14
|
||||
readonly property int fontBody: 18
|
||||
readonly property int fontTitle: 32
|
||||
readonly property int fontCode: 56
|
||||
|
||||
// Cartes du catalogue (affiche 2:3, vignette 16:9)
|
||||
readonly property int posterWidth: 150
|
||||
readonly property int posterHeight: 225
|
||||
readonly property int thumbWidth: 267
|
||||
readonly property int thumbHeight: 150
|
||||
readonly property int cardTextHeight: 52
|
||||
|
||||
// Contrôles
|
||||
readonly property int controlHeight: 48
|
||||
readonly property int radius: 6
|
||||
readonly property int animFast: 120
|
||||
|
||||
// Couleur stable dérivée d'un nom (avatars, icônes de serveur).
|
||||
function avatarColor(name) {
|
||||
var hash = 0;
|
||||
for (var i = 0; i < name.length; i++)
|
||||
hash = (hash * 31 + name.charCodeAt(i)) % 100000;
|
||||
return avatarColors[hash % avatarColors.length];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
singleton Theme 1.0 Theme.qml
|
||||
@@ -0,0 +1,123 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Format.js" as Format
|
||||
|
||||
// Fiche d'un film, d'un épisode ou d'une série (saisons).
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property string itemId: ""
|
||||
property var item: null
|
||||
property var seasons: []
|
||||
property string error: ""
|
||||
|
||||
readonly property bool isSeries: item !== null && item.type === "Series"
|
||||
readonly property real resumeMs: item ? Format.ticksToMs(item.positionTicks) : 0
|
||||
|
||||
fullscreen: true
|
||||
title: item ? item.name : ""
|
||||
subtitle: item ? (item.type === "Episode" && item.seriesName ? item.seriesName + " · " : "")
|
||||
+ Format.infoLine(item) : ""
|
||||
backdrop: item && page.session ? page.session.backdropUrl(item, 720) : ""
|
||||
initialFocus: playButton
|
||||
|
||||
function play(startMs) {
|
||||
var label = item.type === "Episode"
|
||||
? item.seriesName + " · " + Format.episodeCode(item) + " – " + item.name : item.name;
|
||||
page.navigator.push("Player", { itemId: item.id, title: label, startMs: startMs });
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
page.session.loadItem(itemId, function (err, loaded) {
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.item = loaded;
|
||||
if (loaded.type === "Series") {
|
||||
page.session.loadSeasons(loaded.id, function (e, list) {
|
||||
page.seasons = list;
|
||||
seasonsRow.forceActiveFocus();
|
||||
});
|
||||
} else {
|
||||
playButton.forceActiveFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
Rectangle {
|
||||
id: poster
|
||||
width: 200
|
||||
height: 300
|
||||
radius: Theme.radius
|
||||
color: Theme.surface
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
// Épisode : affiche de la série (l'image de l'épisode est en 16:9).
|
||||
source: !page.item || !page.session ? ""
|
||||
: page.item.type === "Episode" && page.item.seriesPrimaryTag
|
||||
? page.session.imageUrl(page.item.seriesId, "Primary", page.item.seriesPrimaryTag, 450)
|
||||
: page.session.posterUrl(page.item, 450)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
sourceSize.height: 300
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: poster.right
|
||||
leftMargin: Theme.spacingXL
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
text: page.error !== "" ? page.error : page.item ? page.item.overview : "Chargement…"
|
||||
color: page.error !== "" ? Theme.error : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: page.isSeries ? 4 : 8
|
||||
elide: Text.ElideRight
|
||||
lineHeight: 1.15
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingM
|
||||
visible: page.item !== null && !page.isSeries
|
||||
|
||||
FocusButton {
|
||||
id: playButton
|
||||
primary: true
|
||||
text: page.resumeMs > 0 ? "Reprendre à " + Format.clock(page.resumeMs) : "Lire"
|
||||
KeyNavigation.right: restartButton.visible ? restartButton : null
|
||||
onClicked: page.play(page.resumeMs)
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: restartButton
|
||||
visible: page.resumeMs > 0
|
||||
text: "Lire depuis le début"
|
||||
KeyNavigation.left: playButton
|
||||
onClicked: page.play(0)
|
||||
}
|
||||
}
|
||||
|
||||
MediaRow {
|
||||
id: seasonsRow
|
||||
width: parent.width
|
||||
visible: page.seasons.length > 0
|
||||
title: "Saisons"
|
||||
items: page.seasons
|
||||
session: page.session
|
||||
onActivated: page.navigator.openItem(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Accueil : rangées « Reprendre », « Mes médias » et derniers ajouts de chaque bibliothèque.
|
||||
// Toutes les rangées sont chargées avant affichage, pour ne pas déplacer le focus en cours de route.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property var rows: []
|
||||
property bool loading: true
|
||||
property string error: ""
|
||||
|
||||
fullscreen: true
|
||||
title: page.session && page.session.currentUser ? "Bonjour " + page.session.currentUser.name : "Accueil"
|
||||
subtitle: page.session && page.session.currentServer ? page.session.currentServer.name : ""
|
||||
initialFocus: switchUserButton
|
||||
|
||||
// La pile a été réinitialisée à la connexion : on reconstruit Serveurs > Utilisateurs.
|
||||
function goBack() {
|
||||
page.navigator.reset("ServerSelect");
|
||||
page.navigator.push("UserSelect");
|
||||
}
|
||||
|
||||
function load() {
|
||||
page.session.loadLibraries(function (err, libraries) {
|
||||
if (err) {
|
||||
page.error = err;
|
||||
page.loading = false;
|
||||
return;
|
||||
}
|
||||
var resume = [];
|
||||
var latest = [];
|
||||
var pending = 1 + libraries.length;
|
||||
function done() {
|
||||
if (--pending === 0)
|
||||
page.build(libraries, resume, latest);
|
||||
}
|
||||
page.session.loadResume(function (e, items) {
|
||||
resume = items;
|
||||
done();
|
||||
});
|
||||
for (var i = 0; i < libraries.length; i++) {
|
||||
(function (index) {
|
||||
page.session.loadLatest(libraries[index].id, function (e, items) {
|
||||
latest[index] = items;
|
||||
done();
|
||||
});
|
||||
})(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function build(libraries, resume, latest) {
|
||||
var list = [];
|
||||
if (resume.length > 0)
|
||||
list.push({ title: "Reprendre", items: resume, landscape: true });
|
||||
if (libraries.length > 0)
|
||||
list.push({ title: "Mes médias", items: libraries, landscape: true });
|
||||
for (var i = 0; i < libraries.length; i++) {
|
||||
if (latest[i] && latest[i].length > 0)
|
||||
list.push({ title: "Ajouts récents · " + libraries[i].name, items: latest[i], landscape: false });
|
||||
}
|
||||
rows = list;
|
||||
loading = false;
|
||||
if (list.length > 0)
|
||||
rowsList.forceActiveFocus();
|
||||
}
|
||||
|
||||
Component.onCompleted: load()
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
// Retour : choix de l'utilisateur (sinon, à la racine de la pile, l'app se fermerait).
|
||||
Keys.onPressed: {
|
||||
if (Remote.isBack(event.key)) {
|
||||
event.accepted = true;
|
||||
page.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
id: actions
|
||||
spacing: Theme.spacingM
|
||||
|
||||
FocusButton {
|
||||
id: switchUserButton
|
||||
text: "Changer d'utilisateur"
|
||||
KeyNavigation.right: logoutButton
|
||||
KeyNavigation.down: rowsList
|
||||
onClicked: page.goBack()
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: logoutButton
|
||||
text: "Se déconnecter"
|
||||
KeyNavigation.left: switchUserButton
|
||||
KeyNavigation.down: rowsList
|
||||
onClicked: {
|
||||
page.session.logout();
|
||||
page.goBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: rowsList
|
||||
anchors {
|
||||
top: actions.bottom
|
||||
topMargin: Theme.spacingL
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
spacing: Theme.spacingS
|
||||
model: page.rows
|
||||
|
||||
delegate: MediaRow {
|
||||
width: rowsList.width
|
||||
title: modelData.title
|
||||
items: modelData.items
|
||||
landscape: modelData.landscape
|
||||
session: page.session
|
||||
onActivated: page.navigator.openItem(item)
|
||||
}
|
||||
|
||||
// La rangée courante reste en haut de la zone visible.
|
||||
onCurrentIndexChanged: positionViewAtIndex(currentIndex, ListView.Beginning)
|
||||
|
||||
KeyNavigation.priority: KeyNavigation.AfterItem
|
||||
KeyNavigation.up: switchUserButton
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: rowsList
|
||||
visible: text !== ""
|
||||
text: page.loading ? "Chargement…"
|
||||
: page.error !== "" ? page.error
|
||||
: page.rows.length === 0 ? "Aucun média disponible pour ce compte." : ""
|
||||
color: page.error !== "" ? Theme.error : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
import "../Shared/Format.js" as Format
|
||||
|
||||
// Contenu d'une bibliothèque en grille d'affiches, chargé par pages à mesure qu'on descend.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property var library: null // { id, name, collectionType }
|
||||
property int total: 0
|
||||
property bool loading: false
|
||||
property string error: ""
|
||||
|
||||
readonly property int pageSize: 60
|
||||
|
||||
fullscreen: true
|
||||
title: library ? library.name : ""
|
||||
subtitle: total > 0 ? total + " élément" + (total > 1 ? "s" : "") : ""
|
||||
initialFocus: grid
|
||||
|
||||
function loadMore() {
|
||||
if (loading || (total > 0 && itemsModel.count >= total))
|
||||
return;
|
||||
loading = true;
|
||||
page.session.loadLibraryItems(library, itemsModel.count, pageSize, function (err, items, count) {
|
||||
page.loading = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.total = count;
|
||||
for (var i = 0; i < items.length; i++)
|
||||
itemsModel.append(items[i]);
|
||||
});
|
||||
}
|
||||
|
||||
Component.onCompleted: loadMore()
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
ListModel {
|
||||
id: itemsModel
|
||||
}
|
||||
|
||||
GridView {
|
||||
id: grid
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
focus: true
|
||||
// Marges pour la carte agrandie (scale).
|
||||
leftMargin: 8
|
||||
topMargin: 8
|
||||
cellWidth: Theme.posterWidth + Theme.spacingL
|
||||
cellHeight: Theme.posterHeight + Theme.cardTextHeight + Theme.spacingL
|
||||
model: itemsModel
|
||||
|
||||
delegate: MediaCard {
|
||||
width: Theme.posterWidth
|
||||
title: model.name
|
||||
subtitle: Format.cardSubtitle(model)
|
||||
imageSource: page.session ? page.session.posterUrl(model) : ""
|
||||
progress: Format.progress(model)
|
||||
played: model.played
|
||||
highlighted: GridView.isCurrentItem && grid.activeFocus
|
||||
onClicked: {
|
||||
grid.currentIndex = index;
|
||||
page.navigator.openItem(itemsModel.get(index));
|
||||
}
|
||||
}
|
||||
|
||||
// Page suivante quand on approche de la fin.
|
||||
onCurrentIndexChanged: if (currentIndex >= count - 14) page.loadMore()
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
page.navigator.openItem(itemsModel.get(currentIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: text !== ""
|
||||
text: page.error !== "" ? page.error
|
||||
: itemsModel.count === 0 ? (page.loading ? "Chargement…" : "Cette bibliothèque est vide.") : ""
|
||||
color: page.error !== "" ? Theme.error : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
|
||||
// Écran 4 : connexion par mot de passe ou par Quick Connect.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property string username: ""
|
||||
property bool quickConnect: false
|
||||
property bool quickConnectAvailable: false
|
||||
property string quickConnectCode: ""
|
||||
property bool busy: false
|
||||
property string error: ""
|
||||
|
||||
title: quickConnect ? "Quick Connect" : "Se connecter"
|
||||
subtitle: page.session && page.session.currentServer
|
||||
? "Serveur : " + page.session.currentServer.name
|
||||
: ""
|
||||
initialFocus: username !== "" ? passwordField : usernameField
|
||||
|
||||
function signIn() {
|
||||
if (busy)
|
||||
return;
|
||||
error = "";
|
||||
busy = true;
|
||||
page.session.authenticate(usernameField.text, passwordField.text, function (err) {
|
||||
page.busy = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
(usernameField.text.trim() === "" ? usernameField : passwordField).forceActiveFocus();
|
||||
return;
|
||||
}
|
||||
// Réinitialise la pile : Retour ne doit pas revenir à l'écran de connexion.
|
||||
page.navigator.reset("Home");
|
||||
});
|
||||
}
|
||||
|
||||
function setQuickConnect(enabled) {
|
||||
error = "";
|
||||
quickConnect = enabled;
|
||||
if (enabled) {
|
||||
quickConnectCode = "";
|
||||
passwordModeButton.forceActiveFocus();
|
||||
page.session.startQuickConnect(function (err, code) {
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.quickConnectCode = code;
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.navigator.reset("Home");
|
||||
});
|
||||
} else {
|
||||
page.session.stopQuickConnect();
|
||||
page.initialFocus.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
// Le bouton Quick Connect n'est proposé que si le serveur l'autorise.
|
||||
Component.onCompleted: {
|
||||
page.session.isQuickConnectEnabled(function (err, enabled) {
|
||||
page.quickConnectAvailable = enabled;
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
Column {
|
||||
id: passwordForm
|
||||
visible: !page.quickConnect
|
||||
width: Math.min(parent.width, 560)
|
||||
spacing: Theme.spacingL
|
||||
|
||||
TextField {
|
||||
id: usernameField
|
||||
width: parent.width
|
||||
label: "Nom d'utilisateur"
|
||||
text: page.username
|
||||
KeyNavigation.down: passwordField
|
||||
onAccepted: passwordField.forceActiveFocus()
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: passwordField
|
||||
width: parent.width
|
||||
label: "Mot de passe"
|
||||
password: true
|
||||
KeyNavigation.up: usernameField
|
||||
KeyNavigation.down: signInButton
|
||||
onAccepted: page.signIn()
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
text: page.error
|
||||
color: Theme.error
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingM
|
||||
|
||||
FocusButton {
|
||||
id: signInButton
|
||||
primary: true
|
||||
text: page.busy ? "Connexion…" : "Se connecter"
|
||||
KeyNavigation.up: passwordField
|
||||
KeyNavigation.right: page.quickConnectAvailable ? quickConnectButton : null
|
||||
onClicked: page.signIn()
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: quickConnectButton
|
||||
visible: page.quickConnectAvailable
|
||||
text: "Utiliser Quick Connect"
|
||||
KeyNavigation.up: passwordField
|
||||
KeyNavigation.left: signInButton
|
||||
onClicked: page.setQuickConnect(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: quickConnectPanel
|
||||
visible: page.quickConnect
|
||||
width: Math.min(parent.width, 560)
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: "Depuis un appareil déjà connecté, ouvrez Quick Connect dans les paramètres de votre compte Jellyfin et saisissez ce code :"
|
||||
color: Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Text {
|
||||
text: page.quickConnectCode !== "" ? page.quickConnectCode : "…"
|
||||
color: Theme.accent
|
||||
font.pixelSize: Theme.fontCode
|
||||
font.bold: true
|
||||
font.letterSpacing: 8
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: page.error !== "" ? page.error : "En attente d'autorisation…"
|
||||
color: page.error !== "" ? Theme.error : Theme.textMuted
|
||||
wrapMode: Text.WordWrap
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: passwordModeButton
|
||||
text: "Utiliser un mot de passe"
|
||||
onClicked: page.setQuickConnect(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
import "../Shared/Format.js" as Format
|
||||
|
||||
// Lecteur plein écran.
|
||||
// Télécommande : OK = lecture/pause, Gauche/Droite = -10 s/+30 s, Haut/Bas = afficher les
|
||||
// informations, Retour = quitter (géré par le Navigator).
|
||||
// La progression est signalée au serveur (reprise, « vu ») au démarrage, toutes les 10 s et à l'arrêt.
|
||||
FocusScope {
|
||||
id: player
|
||||
|
||||
// Injectés par le Navigator
|
||||
property var navigator: null
|
||||
property var session: null
|
||||
property Item initialFocus: null
|
||||
property bool fullscreen: true
|
||||
|
||||
// Paramètres de push("Player", …)
|
||||
property string itemId: ""
|
||||
property string title: ""
|
||||
property real startMs: 0
|
||||
|
||||
property var info: null // résultat de Session.preparePlayback()
|
||||
property bool started: false // lecture effectivement démarrée et signalée
|
||||
property bool resumed: false
|
||||
// Reprise atteinte (ou lecture depuis le début) : avant ça, on ne signale rien, pour
|
||||
// ne pas écraser le point de reprise si le déplacement initial échoue.
|
||||
property bool resumeReached: startMs <= 0
|
||||
property bool finished: false
|
||||
property string error: ""
|
||||
|
||||
function showOsd() {
|
||||
osd.shown = true;
|
||||
osdTimer.restart();
|
||||
}
|
||||
|
||||
function seekBy(deltaMs) {
|
||||
if (video.duration <= 0)
|
||||
return;
|
||||
video.seek(video.position + deltaMs);
|
||||
showOsd();
|
||||
}
|
||||
|
||||
// Rien n'est signalé tant que la lecture n'a pas réellement démarré : un arrêt
|
||||
// signalé à la position 0 effacerait le point de reprise sur le serveur.
|
||||
function report(event) {
|
||||
if (!player.info || !player.started)
|
||||
return;
|
||||
if (event !== "start" && video.position <= 0)
|
||||
return;
|
||||
player.session.reportPlayback(event, player.info, video.position, video.playerState === "paused");
|
||||
}
|
||||
|
||||
// Signale le démarrage une fois la lecture lancée ET la position de reprise atteinte.
|
||||
function maybeReportStart() {
|
||||
if (player.started || !player.info || video.playerState !== "playing" || !player.resumeReached)
|
||||
return;
|
||||
player.started = true;
|
||||
player.report("start");
|
||||
}
|
||||
|
||||
function finish() {
|
||||
if (finished)
|
||||
return;
|
||||
finished = true;
|
||||
report("stop");
|
||||
player.navigator.pop();
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
showOsd();
|
||||
player.session.preparePlayback(itemId, function (err, playback) {
|
||||
if (err) {
|
||||
player.error = err;
|
||||
return;
|
||||
}
|
||||
player.info = playback;
|
||||
video.source = playback.url;
|
||||
});
|
||||
}
|
||||
|
||||
// Retour (le Navigator dépile) ou fin : on signale l'arrêt au serveur.
|
||||
Component.onDestruction: {
|
||||
if (!finished) {
|
||||
finished = true;
|
||||
report("stop");
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
var key = event.key;
|
||||
if (Remote.isAccept(key) || key === Qt.Key_Space || key === Qt.Key_MediaTogglePlayPause
|
||||
|| key === Qt.Key_MediaPlay || key === Qt.Key_MediaPause) {
|
||||
video.togglePause();
|
||||
showOsd();
|
||||
} else if (key === Qt.Key_Left || key === Qt.Key_AudioRewind) {
|
||||
seekBy(-10000);
|
||||
} else if (key === Qt.Key_Right || key === Qt.Key_AudioForward) {
|
||||
seekBy(30000);
|
||||
} else if (key === Qt.Key_Up || key === Qt.Key_Down) {
|
||||
showOsd();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
event.accepted = true;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
}
|
||||
|
||||
VideoSurface {
|
||||
id: video
|
||||
anchors.fill: parent
|
||||
|
||||
onPlayerStateChanged: {
|
||||
player.maybeReportStart();
|
||||
if (playerState === "paused")
|
||||
player.showOsd();
|
||||
}
|
||||
// Reprise : déplacement une fois la durée connue.
|
||||
onDurationChanged: {
|
||||
if (!player.resumed && player.startMs > 0 && duration > 0) {
|
||||
player.resumed = true;
|
||||
seek(player.startMs);
|
||||
}
|
||||
}
|
||||
onPositionChanged: {
|
||||
if (!player.resumeReached && position >= player.startMs - 15000) {
|
||||
player.resumeReached = true;
|
||||
player.maybeReportStart();
|
||||
}
|
||||
}
|
||||
onEnded: player.finish()
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 10000
|
||||
repeat: true
|
||||
running: player.started && !player.finished
|
||||
onTriggered: player.report("progress")
|
||||
}
|
||||
|
||||
// Messages au centre : chargement / erreur.
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width * 0.7
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
visible: text !== ""
|
||||
text: player.error !== "" ? player.error + "\nAppuyez sur Retour pour quitter."
|
||||
: video.playerState === "error" ? video.errorString + "\nAppuyez sur Retour pour quitter."
|
||||
: video.playerState === "loading" || video.playerState === "idle" ? "Chargement…" : ""
|
||||
color: player.error !== "" || video.playerState === "error" ? Theme.error : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
style: Text.Outline
|
||||
styleColor: "black"
|
||||
}
|
||||
|
||||
// Informations de lecture (masquées après 4 s, sauf en pause).
|
||||
Item {
|
||||
id: osd
|
||||
|
||||
property bool shown: true
|
||||
|
||||
anchors.fill: parent
|
||||
opacity: shown || video.playerState === "paused" ? 1 : 0
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: 200 } }
|
||||
|
||||
Rectangle {
|
||||
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
||||
height: 170
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0; color: "transparent" }
|
||||
GradientStop { position: 1; color: "#E0000000" }
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: Theme.pageMargin
|
||||
}
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: player.title
|
||||
elide: Text.ElideRight
|
||||
color: Theme.text
|
||||
font.pixelSize: Theme.fontTitle - 6
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 6
|
||||
radius: 3
|
||||
color: "#55FFFFFF"
|
||||
|
||||
Rectangle {
|
||||
width: video.duration > 0 ? parent.width * Math.min(1, video.position / video.duration) : 0
|
||||
height: parent.height
|
||||
radius: 3
|
||||
color: Theme.accent
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: stateText.implicitHeight
|
||||
|
||||
Text {
|
||||
id: stateText
|
||||
text: video.playerState === "paused" ? "Pause"
|
||||
: video.playerState === "playing" ? "Lecture"
|
||||
: video.playerState === "loading" ? "Chargement…" : ""
|
||||
color: Theme.text
|
||||
font.pixelSize: Theme.fontSmall
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
text: Format.clock(video.position) + " / " + Format.clock(video.duration)
|
||||
color: Theme.text
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: osdTimer
|
||||
interval: 4000
|
||||
onTriggered: osd.shown = false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
import "../Shared/Format.js" as Format
|
||||
|
||||
// Épisodes d'une saison ; OK ouvre la fiche de l'épisode.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property string seriesId: ""
|
||||
property string seasonId: ""
|
||||
property string seasonName: ""
|
||||
property string seriesName: ""
|
||||
property var episodes: []
|
||||
property bool loading: true
|
||||
property string error: ""
|
||||
|
||||
fullscreen: true
|
||||
title: seriesName
|
||||
subtitle: seasonName
|
||||
initialFocus: list
|
||||
|
||||
Component.onCompleted: {
|
||||
page.session.loadEpisodes(seriesId, seasonId, function (err, items) {
|
||||
page.loading = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.episodes = items;
|
||||
list.forceActiveFocus();
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
ListView {
|
||||
id: list
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
focus: true
|
||||
spacing: Theme.spacingS
|
||||
model: page.episodes
|
||||
|
||||
delegate: Rectangle {
|
||||
id: row
|
||||
|
||||
readonly property bool highlighted: ListView.isCurrentItem && list.activeFocus
|
||||
|
||||
width: list.width
|
||||
height: 150
|
||||
radius: Theme.radius
|
||||
color: highlighted ? Theme.focusBackground : "transparent"
|
||||
|
||||
MediaCard {
|
||||
id: thumb
|
||||
anchors { left: parent.left; leftMargin: Theme.spacingS; verticalCenter: parent.verticalCenter }
|
||||
width: 240
|
||||
height: 135
|
||||
imageHeight: 135
|
||||
showText: false
|
||||
imageSource: page.session ? page.session.thumbUrl(modelData) : ""
|
||||
progress: Format.progress(modelData)
|
||||
played: modelData.played
|
||||
title: modelData.name
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: thumb.right
|
||||
leftMargin: Theme.spacingL
|
||||
right: parent.right
|
||||
rightMargin: Theme.spacingM
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
spacing: 4
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: modelData.name
|
||||
elide: Text.ElideRight
|
||||
color: row.highlighted ? Theme.textOnFocus : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
text: "Épisode " + modelData.indexNumber
|
||||
+ (modelData.runtimeTicks ? " · " + Format.runtime(modelData.runtimeTicks) : "")
|
||||
color: row.highlighted ? Theme.textOnFocusMuted : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: modelData.overview
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 3
|
||||
elide: Text.ElideRight
|
||||
color: row.highlighted ? Theme.textOnFocusMuted : Theme.textMuted
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
list.currentIndex = index;
|
||||
page.navigator.openItem(modelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
page.navigator.openItem(page.episodes[currentIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: text !== ""
|
||||
text: page.loading ? "Chargement…"
|
||||
: page.error !== "" ? page.error
|
||||
: page.episodes.length === 0 ? "Aucun épisode." : ""
|
||||
color: page.error !== "" ? Theme.error : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
|
||||
// Écran 2 : saisie manuelle de l'adresse d'un serveur.
|
||||
// Le clavier virtuel de la box n'a ni « : » ni « / » : on saisit l'hôte seul, le port
|
||||
// à part (facultatif), et Session détecte le protocole (https/http) et le port.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property bool busy: false
|
||||
property string error: ""
|
||||
|
||||
title: "Ajouter un serveur"
|
||||
subtitle: "Saisissez l'adresse IP ou le nom de domaine de votre serveur Jellyfin. Le protocole et le port sont détectés automatiquement."
|
||||
initialFocus: addressField
|
||||
|
||||
function connect() {
|
||||
if (busy)
|
||||
return;
|
||||
error = "";
|
||||
busy = true;
|
||||
page.session.connectToServer(addressField.text, portField.text, function (err) {
|
||||
page.busy = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
var port = portField.text.trim();
|
||||
(port !== "" && !page.session.isValidPort(port) ? portField : addressField).forceActiveFocus();
|
||||
return;
|
||||
}
|
||||
// Remplace cet écran : Retour depuis la liste des utilisateurs ramène aux serveurs.
|
||||
page.navigator.replace("UserSelect");
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
Column {
|
||||
width: Math.min(parent.width, 560)
|
||||
spacing: Theme.spacingL
|
||||
|
||||
TextField {
|
||||
id: addressField
|
||||
width: parent.width
|
||||
label: "Adresse du serveur"
|
||||
placeholder: "192.168.1.20 ou jellyfin.example.com"
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
KeyNavigation.down: portField
|
||||
onAccepted: portField.forceActiveFocus()
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: portField
|
||||
width: 200
|
||||
label: "Port (facultatif)"
|
||||
placeholder: "Auto"
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
validator: RegExpValidator { regExp: /\d{0,5}/ }
|
||||
maximumLength: 5
|
||||
KeyNavigation.up: addressField
|
||||
KeyNavigation.down: connectButton
|
||||
onAccepted: page.connect()
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: text !== ""
|
||||
text: page.error
|
||||
color: Theme.error
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: connectButton
|
||||
primary: true
|
||||
text: page.busy ? "Recherche du serveur…" : "Se connecter"
|
||||
KeyNavigation.up: portField
|
||||
onClicked: page.connect()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Écran 1 : choix d'un serveur enregistré ou découvert sur le réseau local.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
title: "Sélectionner un serveur"
|
||||
subtitle: serverList.count > 0
|
||||
? "Choisissez le serveur Jellyfin auquel vous connecter."
|
||||
: "Aucun serveur enregistré. Ajoutez l'adresse de votre serveur Jellyfin."
|
||||
initialFocus: serverList.count > 0 ? serverList : addButton
|
||||
|
||||
function openServer(index) {
|
||||
page.session.selectServer(index);
|
||||
page.navigator.push("UserSelect");
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: serverList
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: addButton.top
|
||||
bottomMargin: Theme.spacingL
|
||||
}
|
||||
clip: true
|
||||
spacing: Theme.spacingS
|
||||
model: page.session ? page.session.servers : null
|
||||
|
||||
// Serveur ajouté après l'affichage (dev-config) : on y place le focus.
|
||||
onCountChanged: {
|
||||
if (count > 0 && addButton.activeFocus) {
|
||||
currentIndex = 0;
|
||||
forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ServerItem {
|
||||
width: serverList.width
|
||||
name: model.name
|
||||
address: model.address
|
||||
highlighted: ListView.isCurrentItem && serverList.activeFocus
|
||||
onClicked: {
|
||||
serverList.currentIndex = index;
|
||||
page.openServer(index);
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
page.openServer(currentIndex);
|
||||
}
|
||||
}
|
||||
// Laisse la ListView gérer Haut/Bas ; on ne sort qu'en bout de liste.
|
||||
KeyNavigation.priority: KeyNavigation.AfterItem
|
||||
KeyNavigation.down: addButton
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: addButton
|
||||
anchors {
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
}
|
||||
text: "Ajouter un serveur"
|
||||
KeyNavigation.up: serverList.count > 0 ? serverList : null
|
||||
onClicked: page.navigator.push("ServerAdd")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Écran 3 : choix de l'utilisateur parmi les comptes publics du serveur.
|
||||
// Si le serveur masque ses comptes, seule la carte « Ajouter un compte » est proposée,
|
||||
// plus les comptes de test éventuels (freebox-jellyfin deploy --user).
|
||||
Page {
|
||||
id: page
|
||||
|
||||
property var publicUsers: []
|
||||
// Comptes publics + comptes de test absents de la liste publique.
|
||||
property var users: mergeUsers(publicUsers, page.session ? page.session.devUsers : [])
|
||||
property bool loading: true
|
||||
property bool busy: false
|
||||
property string error: ""
|
||||
|
||||
title: "Qui regarde ?"
|
||||
subtitle: page.session && page.session.currentServer
|
||||
? page.session.currentServer.name + " · " + page.session.currentServer.address
|
||||
: ""
|
||||
initialFocus: userList
|
||||
|
||||
function mergeUsers(publicList, devList) {
|
||||
var result = publicList.slice();
|
||||
for (var i = 0; i < devList.length; i++) {
|
||||
var known = false;
|
||||
for (var j = 0; j < publicList.length; j++)
|
||||
known = known || publicList[j].name.toLowerCase() === devList[i].name.toLowerCase();
|
||||
if (!known)
|
||||
result.push({ name: devList[i].name, hasPassword: true, devPassword: devList[i].password });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function signInAs(name, password) {
|
||||
error = "";
|
||||
busy = true;
|
||||
page.session.authenticate(name, password, function (err) {
|
||||
page.busy = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.navigator.reset("Home");
|
||||
});
|
||||
}
|
||||
|
||||
function openUser(index) {
|
||||
if (busy)
|
||||
return;
|
||||
// Dernière carte : « Ajouter un compte » → identifiant libre.
|
||||
if (index >= users.length) {
|
||||
page.navigator.push("Login");
|
||||
return;
|
||||
}
|
||||
var user = users[index];
|
||||
// Compte de test avec mot de passe fourni : connexion directe.
|
||||
if (user.devPassword !== undefined) {
|
||||
signInAs(user.name, user.devPassword);
|
||||
return;
|
||||
}
|
||||
if (user.hasPassword) {
|
||||
page.navigator.push("Login", { username: user.name });
|
||||
return;
|
||||
}
|
||||
// Compte sans mot de passe : connexion directe, comme sur Android TV.
|
||||
signInAs(user.name, "");
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
page.session.loadPublicUsers(function (err, users) {
|
||||
page.loading = false;
|
||||
if (err) {
|
||||
page.error = err;
|
||||
return;
|
||||
}
|
||||
page.publicUsers = users;
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: if (page.session) page.session.cancel()
|
||||
|
||||
ListView {
|
||||
id: userList
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: 220
|
||||
orientation: ListView.Horizontal
|
||||
spacing: Theme.spacingL
|
||||
model: page.users.concat([{ name: "Ajouter un compte", add: true }])
|
||||
|
||||
delegate: UserCard {
|
||||
name: modelData.name
|
||||
addCard: modelData.add === true
|
||||
highlighted: ListView.isCurrentItem && userList.activeFocus
|
||||
onClicked: {
|
||||
userList.currentIndex = index;
|
||||
page.openUser(index);
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
page.openUser(currentIndex);
|
||||
}
|
||||
}
|
||||
KeyNavigation.priority: KeyNavigation.AfterItem
|
||||
KeyNavigation.down: changeServerButton
|
||||
}
|
||||
|
||||
Text {
|
||||
id: statusText
|
||||
anchors {
|
||||
top: userList.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
visible: text !== ""
|
||||
text: page.busy ? "Connexion…"
|
||||
: page.loading ? "Chargement des utilisateurs…"
|
||||
: page.error !== "" ? page.error
|
||||
: page.users.length === 0 ? "Les comptes de ce serveur ne sont pas affichés publiquement : choisissez « Ajouter un compte » pour vous connecter."
|
||||
: ""
|
||||
color: page.error !== "" && !page.busy ? Theme.error : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: changeServerButton
|
||||
anchors {
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
}
|
||||
text: "Changer de serveur"
|
||||
KeyNavigation.up: userList
|
||||
onClicked: page.navigator.reset("ServerSelect")
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Jellyfin",
|
||||
"identifier": "com.stilobique.jellyfin",
|
||||
"version": "0.1.0",
|
||||
"description": "Jellyfin for Freebox",
|
||||
"icon": "icon.png",
|
||||
"capabilities": {
|
||||
"net_wan": "required"
|
||||
},
|
||||
"entryPoints": {
|
||||
"main": {
|
||||
"file": "Jellyfin.qml",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user