Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test ci #9

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 0 additions & 31 deletions .github/workflows/02_get_artifact.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Create diff
run: |
Expand All @@ -17,19 +17,20 @@ jobs:
cp patch/*.qml patch/*.png patch/*.js patch/*.svg patch/*.qm .github/patch_data |:

- name: Upload build result
uses: actions/upload-artifact@v2
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: ${{ github.head_ref }}
path: .github/patch_data

- name: 'Comment PR'
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hello @${{ github.event.pull_request.user.login }}\nYour patch is ready as Artifact inside of [Checks](https://github.com/sailfishos-patches/sailfish-qml/pull/${{ github.event.pull_request.number }}/checks)\n\nTrying to get direct download link in couple of seconds...'
body: 'Hello @${{ github.event.pull_request.user.login }}\nYour patch is ready!\n\n[Download link](${{ steps.artifact-upload-step.outputs.artifact-url }})'
})
151 changes: 151 additions & 0 deletions usr/lib/jolla-mediaplayer/plugins/jolla/AlbumPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
// -*- qml -*-

import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Media 1.0
import com.jolla.mediaplayer 1.0

Page {
id: albumPage

property var media

Loader {
active: albumPage.isLandscape && coverArt.source != ""
anchors {
top: parent.top
bottom: parent.bottom
left: parent.horizontalCenter
right: parent.right
}

Component.onCompleted: setSource("CoverArtHolder.qml", { "view": view, "coverArt": coverArt })
}

CoverArt {
id: coverArt

// re-evaluate when state changes
source: (albumArtProvider.extracting || true) ? albumArtProvider.albumArt(media.title, media.author) : ""
}

MediaPlayerListView {
id: view

model: GriloTrackerModel {
query: {
//: placeholder string for albums without a known name
//% "Unknown album"
var unknownAlbum = qsTrId("mediaplayer-la-unknown-album")

//: placeholder string to be shown for media without a known artist
//% "Unknown artist"
var unknownArtist = qsTrId("mediaplayer-la-unknown-artist")

return AudioTrackerHelpers.getSongsQuery(albumHeader.searchText,
{"unknownArtist": unknownArtist,
"unknownAlbum": unknownAlbum,
"authorId": media.get("tracker-urn"),
"albumId": media.id})
}
}

contentWidth: albumPage.width

PullDownMenu {
MenuItem {
//: Shuffle all menu entry in album page
//% "Shuffle all"
text: qsTrId("mediaplayer-me-album-shuffle-all")
onClicked: AudioPlayer.shuffleAndPlay(view.model, view.count)
}

NowPlayingMenuItem { }

MenuItem {
//: Search menu entry
//% "Search"
text: qsTrId("mediaplayer-me-search")
onClicked: albumHeader.enableSearch()
enabled: view.count > 0 || albumHeader.searchText !== ''
}
}

ViewPlaceholder {
//: Placeholder text for an empty search view
//% "No items found"
text: qsTrId("mediaplayer-la-empty-search")
enabled: view.count === 0 && !busyIndicator.running
}

PageBusyIndicator {
id: busyIndicator

running: view.model.fetching
}

Component {
id: addPageComponent
AddToPlaylistPage { }
}

header: SearchPageHeader {
id: albumHeader
width: albumPage.isLandscape ? view.contentWidth : view.width

//: header for the page showing the songs that don't belong to a known album
//% "Unknown album"
title: media.title !== "" ? media.title : qsTrId("mediaplayer-la-unknown-album")

//: All songs search field placeholder text
//% "Search song"
placeholderText: qsTrId("mediaplayer-tf-album-search")

coverArt: albumPage.isLandscape ? null : coverArt
}

delegate: MediaListDelegate {
id: delegate

property var itemMedia: media

formatFilter: albumHeader.searchText
menu: menuComponent
onClicked: AudioPlayer.play(view.model, index)

ListView.onAdd: AddAnimation { target: delegate }
ListView.onRemove: animateRemoval()

function remove() {
AudioPlayer.remove(itemMedia, delegate, playlists)
}

Component {
id: menuComponent

ContextMenu {
width: view.contentWidth

MenuItem {
//: Add to playlist context menu item in album page
//% "Add to playlist"
text: qsTrId("mediaplayer-me-album-add-to-playlist")
onClicked: pageStack.animatorPush(addPageComponent, {media: itemMedia})
}
MenuItem {
//: Add to playing queue context menu item in album page
//% "Add to playing queue"
text: qsTrId("mediaplayer-me-album-add-to-playing-queue")
onClicked: AudioPlayer.addToQueue(itemMedia)
}
MenuItem {
//: Delete item
//% "Delete"
text: qsTrId("mediaplayer-me-all-songs-delete")
onClicked: remove()
}
}
}
}
}
}
104 changes: 104 additions & 0 deletions usr/lib/jolla-mediaplayer/plugins/jolla/AlbumsPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// -*- qml -*-

import QtQuick 2.0
import Sailfish.Silica 1.0
import com.jolla.mediaplayer 1.0
import Nemo.Thumbnailer 1.0

Page {
id: albumsPage

property var model
property string searchText

TrackerQueriesBuilder {
id: queriesBuilder
}

MediaPlayerListView {
id: view

property string query: queriesBuilder.getAlbumsQuery(albumsHeader.searchText)

model: albumsPage.model

Binding {
target: albumsPage.model.source
property: "query"
value: view.query
}

PullDownMenu {
NowPlayingMenuItem { }

MenuItem {
//: Search menu entry
//% "Search"
text: qsTrId("mediaplayer-me-search")
onClicked: albumsHeader.enableSearch()
enabled: view.count > 0 || albumsHeader.searchText !== ''
}
}

ViewPlaceholder {
text: {
if (albumsHeader.searchText !== '') {
//: Placeholder text for an empty search view
//% "No items found"
return qsTrId("mediaplayer-la-empty-search")
} else {
//: Placeholder text for an empty view
//% "Get some media"
return qsTrId("mediaplayer-la-get-some-media")
}
}
enabled: view.count === 0 && !busyIndicator.running
}

PageBusyIndicator {
id: busyIndicator

running: albumsPage.model.source.fetching
}

header: SearchPageHeader {
id: albumsHeader
width: parent.width

//: title for the Albums page
//% "Albums"
title: qsTrId("mediaplayer-he-albums")

//: Albums search field placeholder text
//% "Search album"
placeholderText: qsTrId("mediaplayer-tf-albums-search")

searchText: albumsPage.searchText
Component.onCompleted: if (searchText !== '') enableSearch()
}

delegate: MediaContainerListDelegate {
id: delegate

contentHeight: albumArt.height
leftPadding: albumArt.width + Theme.paddingLarge
formatFilter: albumsHeader.searchText
title: media.title
subtitle: media.author
titleFont.pixelSize: Theme.fontSizeLarge
subtitleFont.pixelSize: Theme.fontSizeMedium
onClicked: pageStack.animatorPush(Qt.resolvedUrl("AlbumPage.qml"), {media: media})

ListView.onAdd: AddAnimation { target: delegate }
ListView.onRemove: animateRemoval()

AlbumArt {
id: albumArt

// re-evaluate when state changes
source: (albumArtProvider.extracting || true) ? albumArtProvider.albumThumbnail(title, subtitle) : ""
highlighted: delegate.highlighted
}
}
}
}
Loading
Loading