5 Commits

Author SHA1 Message Date
Kevin Restaino ffc501a48d feat: arm64 and amd64 builds 2024-01-09 13:59:10 -05:00
Kevin Restaino e20f9155cb chore: create LICENSE 2024-01-08 18:15:10 -05:00
Kevin Restaino 816444e309 chore: bump version 2024-01-08 17:33:30 -05:00
Kevin Restaino fce99b39cb feat: third search, replace "part" with "pt." 2024-01-08 17:30:03 -05:00
Kevin Restaino f3fe277017 feat: log version 2024-01-08 16:47:53 -05:00
4 changed files with 57 additions and 1 deletions
+21
View File
@@ -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.
+1 -1
View File
@@ -1 +1 @@
1.1.0
1.3.0
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# Ensure the script stops if there is an error
set -e
# Read version from the VERSION file
VERSION=$(cat 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
# 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
# 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"
+16
View File
@@ -143,6 +143,11 @@ parser.add_argument(
help="limit to processing [NUM] artists from the start index",
)
parser.add_argument(
"-v", "--version", action="version", version=f"%(prog)s {__version__}"
)
args = parser.parse_args()
ARTIST_IDs = args.artist if args.artist else []
@@ -150,6 +155,8 @@ ALBUM_IDs = args.album if args.album else []
START = args.start
LIMIT = args.limit
logging.info(f"{BOLD}Version:{RESET} {LIGHT_YELLOW}sptnr v{__version__}{RESET}")
if args.preview:
logging.info(f"{LIGHT_YELLOW}Preview mode, no changes will be made.{RESET}")
PREVIEW = 1
@@ -254,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)