forked from CopyBot/sptnr
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ffc501a48d | |||
| e20f9155cb | |||
| 816444e309 | |||
| fce99b39cb |
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Kevin Restaino
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+7
-7
@@ -6,14 +6,14 @@ set -e
|
||||
# Read version from the VERSION file
|
||||
VERSION=$(cat VERSION)
|
||||
|
||||
# Build the Docker image with the version tag
|
||||
docker build -t krestaino/sptnr:$VERSION .
|
||||
# Set up the builder instance (only needs to be done once, so you can comment this out after the first run)
|
||||
# docker buildx create --name mybuilder --use
|
||||
# docker buildx inspect mybuilder --bootstrap
|
||||
|
||||
# Tag the built image as latest
|
||||
docker tag krestaino/sptnr:$VERSION krestaino/sptnr:latest
|
||||
# Build and push the Docker image for both arm64 and amd64 platforms with the version tag
|
||||
docker buildx build --platform linux/arm64,linux/amd64 -t krestaino/sptnr:$VERSION . --push
|
||||
|
||||
# Push both tags to the Docker registry
|
||||
docker push krestaino/sptnr:$VERSION
|
||||
docker push krestaino/sptnr:latest
|
||||
# Build and push the 'latest' tag as well
|
||||
docker buildx build --platform linux/arm64,linux/amd64 -t krestaino/sptnr:latest . --push
|
||||
|
||||
echo "Docker images tagged and pushed: $VERSION and latest"
|
||||
|
||||
@@ -261,6 +261,15 @@ def process_track(track_id, artist_name, album, track_name):
|
||||
)
|
||||
found_track = len(spotify_data.get("tracks", {}).get("items", [])) > 0
|
||||
|
||||
if not found_track:
|
||||
# Tertiary Search (replace 'Part' with 'Pt.')
|
||||
modified_track_name = track_name.replace("Part", "Pt.")
|
||||
encoded_modified_track_name = url_encode(modified_track_name)
|
||||
spotify_data = search_spotify(
|
||||
f"{encoded_modified_track_name}%20artist:{encoded_artist_name}"
|
||||
)
|
||||
found_track = len(spotify_data.get("tracks", {}).get("items", []))
|
||||
|
||||
if found_track:
|
||||
popularity = spotify_data["tracks"]["items"][0].get("popularity", 0)
|
||||
rating = get_rating_from_popularity(popularity)
|
||||
|
||||
Reference in New Issue
Block a user