[-]
[+]
|
Added |
_service:tar_git:harbour-musicex.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/musicex.git</param>
<param name="branch">main</param>
- <param name="revision">0.41</param>
+ <param name="revision">0.44</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex-0.44.tar.bz2/qml/pages/AlbumPage.qml
^
|
@@ -7,7 +7,9 @@
property var artist_data
property var album_data
+ property var track_data
property var tracks: []
+ property bool tracks_requested: false
CachedImage {
id: album_thumb
@@ -104,6 +106,7 @@
artist_data: album_page.artist_data
album_data: album_page.album_data
+ tracks_requested: album_page.tracks_requested
}
}
}
@@ -143,6 +146,7 @@
Component.onCompleted: {
app.signal_tracks.connect(handle_tracks)
+ tracks_requested = true
python.get_tracks(album_data.idAlbum)
}
@@ -152,5 +156,6 @@
function handle_tracks(data) {
tracks = data
+ tracks_requested = false
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex-0.44.tar.bz2/qml/pages/MainHandler.qml
^
|
@@ -175,6 +175,11 @@
console.log('mpris artist:', player_artist_name)
}
+ onPlayer_artworkChanged: {
+ mpris.metaData.artUrl = player_artwork
+ console.log('mpris artUrl:', player_artwork)
+ }
+
onPlayer_volumeChanged: {
main_handler.audio_player.volume = player_volume * track_volume
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex-0.44.tar.bz2/qml/pages/TracksPage.qml
^
|
@@ -8,7 +8,7 @@
property var album_data
property var local_media_files: []
property int local_media_files_count: 0
-
+ property bool tracks_requested
property var tracks: []
anchors.fill: parent
@@ -29,6 +29,7 @@
SilicaListView {
width: parent.width;
height: parent.height
+ id: list_view
model: album_page.tracks
@@ -99,6 +100,12 @@
}
}
}
+
+ BusyIndicator {
+ size: BusyIndicatorSize.Large
+ anchors.centerIn: list_view
+ running: tracks_requested
+ }
Component.onCompleted: {
app.signal_media_download.connect(handle_media_download)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex-0.44.tar.bz2/src/audiodb.py
^
|
@@ -10,15 +10,15 @@
import musicbrainz
class Audiodb:
- URL_ARTIST_BY_NAME="https://theaudiodb.com/api/v1/json/2/search.php?s={}"
- URL_ARTIST_BY_ID="https://theaudiodb.com/api/v1/json/2/artist.php?i={}"
+ URL_ARTIST_BY_NAME="https://theaudiodb.com/api/v1/json/2139078587215309723505/search.php?s={}"
+ URL_ARTIST_BY_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/artist.php?i={}"
URL_ARTIST_BY_MBID="https://theaudiodb.com/api/v1/json/2139078587215309723505/artist-mb.php?i={}"
- URL_DISCOGRAPHY_BY_NAME="https://theaudiodb.com/api/v1/json/2/discography.php?s={}"
- URL_ALBUMS_BY_ARTIST_ID="https://theaudiodb.com/api/v1/json/2/album.php?i={}"
- URL_ALBUM_BY_ID="https://theaudiodb.com/api/v1/json/2/album.php?m={}"
- URL_TRACKS_BY_ALBUM_ID="https://theaudiodb.com/api/v1/json/2/track.php?m={}"
- URL_VIDEOS_BY_ARTIST_ID="https://theaudiodb.com/api/v1/json/2/mvid.php?i={}"
- URL_TRACK_BY_ID="https://theaudiodb.com/api/v1/json/2/track.php?h={}"
+ URL_DISCOGRAPHY_BY_NAME="https://theaudiodb.com/api/v1/json/2139078587215309723505/discography.php?s={}"
+ URL_ALBUMS_BY_ARTIST_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/album.php?i={}"
+ URL_ALBUM_BY_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/album.php?m={}"
+ URL_TRACKS_BY_ALBUM_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/track.php?m={}"
+ URL_VIDEOS_BY_ARTIST_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/mvid.php?i={}"
+ URL_TRACK_BY_ID="https://theaudiodb.com/api/v1/json/2139078587215309723505/track.php?h={}"
URL_ALBUMS_TRENDING="https://theaudiodb.com/api/v1/json/2139078587215309723505/trending.php?country=us&format=albums"
URL_TRACKS_LOVED="https://theaudiodb.com/api/v1/json/2139078587215309723505/mostloved.php?format=track"
CACHE_FILE = "audiodb_cache.json"
@@ -384,6 +384,7 @@
self.cache['album_ids_by_artist_id'][str(artist_id)] = album_ids
def get_tracks(self, album_id):
+ tracks_sent = False
tracks = []
refresh_cache = False
track_ids = self.cache_get(album_id, 'track_ids_by_album_id')
@@ -395,17 +396,29 @@
if 'chache_expired' in track:
refresh_cache = True
- if len(tracks) > 0 and not refresh_cache:
+ if len(tracks) > 0:
+ print('Audiodb get_tracks - sending cached tracks: ', len(tracks))
pyotherside.send("tracks_details", {'track': tracks})
- return True
+ tracks_sent = True
+ if not refresh_cache:
+ return True
+ else:
+ print('Audiodb get_tracks - no cached tracks available')
+ print('Audiodb get_tracks - requesting tracks')
result = self.__url_get(self.URL_TRACKS_BY_ALBUM_ID.format(album_id))
if not result:
if len(tracks) > 0:
+ print('Audiodb get_tracks - request failed - sending cached tracks: ', len(tracks))
pyotherside.send("tracks_details", {'track': tracks})
+ tracks_sent = True
return True
+
+ if not tracks_sent:
+ pyotherside.send("tracks_details", {'track': []})
return False
+ print('Audiodb get_tracks - sending tracks: ', len(result))
pyotherside.send("tracks_details", result)
track_ids = self.cache_put_multi('idTrack', 'tracks', result, 'track')
self.cache['track_ids_by_album_id'][str(album_id)] = track_ids
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-musicex-0.44.tar.bz2/src/youtube.py
^
|
@@ -204,8 +204,13 @@
if not self.check_title(yo.title.lower(), artist.lower(), track.lower()):
continue
- print('VIDEO primary:', yo.title, ' / ', yo.length, ' / ', yo.thumbnail_url, ' / ', yo.vid_info['videoDetails']['videoId'], ' / ', yo.views)
- videos.append({'video_id': yo.vid_info['videoDetails']['videoId'], 'title': yo.title, 'length': yo.length, 'views': yo.views, 'thumbnail_url': yo.thumbnail_url})
+ try:
+ print('VIDEO primary:', yo.title, ' / ', yo.length, ' / ', yo.thumbnail_url, ' / ', yo.vid_info['videoDetails']['videoId'], ' / ', yo.views)
+ videos.append({'video_id': yo.vid_info['videoDetails']['videoId'], 'title': yo.title, 'length': yo.length, 'views': yo.views, 'thumbnail_url': yo.thumbnail_url})
+ except Exception as err:
+ print('VIDEO primary error - ignoring video: ', err)
+ continue
+
pyotherside.send("videos_list", data)
except Exception as err:
print('Youtube search_media - error: ', err)
@@ -216,8 +221,13 @@
if len(videos) < 2:
try:
for yo in so.results:
- print('VIDEO secondary:', yo.title, ' / ', yo.length, ' / ', yo.thumbnail_url, ' / ', yo.vid_info['videoDetails']['videoId'], ' / ', yo.views)
- videos.append({'video_id': yo.vid_info['videoDetails']['videoId'], 'title': yo.title, 'length': yo.length, 'views': yo.views, 'thumbnail_url': yo.thumbnail_url})
+ try:
+ print('VIDEO secondary:', yo.title, ' / ', yo.length, ' / ', yo.thumbnail_url, ' / ', yo.vid_info['videoDetails']['videoId'], ' / ', yo.views)
+ videos.append({'video_id': yo.vid_info['videoDetails']['videoId'], 'title': yo.title, 'length': yo.length, 'views': yo.views, 'thumbnail_url': yo.thumbnail_url})
+ except Exception as err:
+ print('VIDEO secondary error - ignoring video: ', err)
+ continue
+
pyotherside.send("videos_list", data)
except Exception as err:
print('Youtube search_media - error: ', err)
@@ -279,39 +289,44 @@
if not self.check_title(yo.title.lower(), artist.lower(), track.lower()):
continue
- if length:
- if (yo.length > length + 30 or yo.length < length - 10):
+ score = 0
+
+ try:
+ if length:
+ if (yo.length > length + 30 or yo.length < length - 10):
+ continue
+ elif yo.length > 2000:
continue
- elif yo.length > 2000:
- continue
- score = 0
+ if length:
+ if yo.length == length:
+ score += 100
+ elif yo.length == length + 1 or yo.length == length - 1:
+ score += 90
- if length:
- if yo.length == length:
+ title_lower = yo.title.lower()
+ if "official lyrics video" in title_lower:
score += 100
- elif yo.length == length + 1 or yo.length == length - 1:
+ elif "official audio" in title_lower:
+ score += 100
+ elif "official music video" in title_lower:
score += 90
+ elif "official hd video" in title_lower:
+ score += 90
+ elif "(audio)" in title_lower:
+ score += 80
+ elif "(lyrics)" in title_lower:
+ score += 50
+
+ if "remix" in title_lower and "remix" not in track.lower():
+ score += -80
+
+ if "live" in title_lower and "live" not in track.lower():
+ score += -50
- title_lower = yo.title.lower()
- if "official lyrics video" in title_lower:
- score += 100
- elif "official audio" in title_lower:
- score += 100
- elif "official music video" in title_lower:
- score += 90
- elif "official hd video" in title_lower:
- score += 90
- elif "(audio)" in title_lower:
- score += 80
- elif "(lyrics)" in title_lower:
- score += 50
-
- if "remix" in title_lower and "remix" not in track.lower():
- score += -80
-
- if "live" in title_lower and "live" not in track.lower():
- score += -50
+ except Exception as err:
+ print('find_download_media error - ignoring video: ', err)
+ continue
if score > video_score:
video = yo
|