Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d71fc2605 | |||
| c49a32a741 | |||
| e62ddaa19c |
@@ -1,40 +0,0 @@
|
|||||||
# This workflow will build a golang project
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
|
||||||
|
|
||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: ["darwin","linux","windows"]
|
|
||||||
arch: ["amd64","arm64"]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: 1.19
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
go get .
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o spotigram_${{ matrix.os }}_${{ matrix.arch }} -v main.go
|
|
||||||
|
|
||||||
- name: upload artifacts
|
|
||||||
uses: actions/upload-artifact@v3.1.2
|
|
||||||
with:
|
|
||||||
name: spotigram_${{ matrix.os }}_${{ matrix.arch }}
|
|
||||||
path: spotigram_${{ matrix.os }}_${{ matrix.arch }}
|
|
||||||
retention-days: 90
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
Spotigram
|
Spotigram
|
||||||
=========
|
=========
|
||||||
|
|
||||||
_Wenns' gut werden muss_
|
_Wenns' gut werden muss_
|
||||||
|
|
||||||
[](https://git.jonasmoeller.de/aledjones/spotigram)
|
|
||||||
|
|
||||||
## Was ist Spotigram?
|
## Was ist Spotigram?
|
||||||
|
|
||||||
|
|||||||
+18
-3
@@ -101,8 +101,22 @@ It is not planned to extend this in the future.`,
|
|||||||
err = viper.WriteConfig()
|
err = viper.WriteConfig()
|
||||||
cobra.CheckErr(err)
|
cobra.CheckErr(err)
|
||||||
}
|
}
|
||||||
results, err := client.Search(ctx, strings.TrimPrefix(update.Message.Text, "/spotigram "), spotify.SearchTypeTrack)
|
|
||||||
cobra.CheckErr(err)
|
var results *spotify.SearchResult
|
||||||
|
|
||||||
|
if strings.HasPrefix(update.Message.Text, "/spotigram ") {
|
||||||
|
results, err = client.Search(ctx, strings.TrimPrefix(update.Message.Text, "/spotigram "), spotify.SearchTypeTrack)
|
||||||
|
cobra.CheckErr(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !strings.HasPrefix(update.Message.Text, "/spotigram ") {
|
||||||
|
msg.Text = "⛔ Ooops, du musst einen Titel angeben!\n <code>/spotigram [Titel]</code>"
|
||||||
|
msg.ParseMode = "HTML"
|
||||||
|
_, err = bot.Send(msg)
|
||||||
|
cobra.CheckErr(err)
|
||||||
|
|
||||||
|
fmt.Printf("Command used incorrectly.")
|
||||||
|
}
|
||||||
|
|
||||||
if results != nil {
|
if results != nil {
|
||||||
|
|
||||||
@@ -145,7 +159,8 @@ It is not planned to extend this in the future.`,
|
|||||||
track.Name,
|
track.Name,
|
||||||
track.Artists[0].Name)
|
track.Artists[0].Name)
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
if !contains(trackIDs, results.Tracks.Tracks[0].ID) {
|
||||||
track := results.Tracks.Tracks[0]
|
track := results.Tracks.Tracks[0]
|
||||||
|
|
||||||
addTrackResponse, err := client.AddTracksToPlaylist(ctx,
|
addTrackResponse, err := client.AddTracksToPlaylist(ctx,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module git.jonasmoeller.de/aledjones/spotigram
|
module github.com/aledjones/spotigram
|
||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright © 2024 Jonas Möller <mail@jonasmoeller.de>
|
Copyright © 2023 Jonas Möller <mail@jonasmoeller.de>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -21,7 +21,7 @@ THE SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "git.jonasmoeller.de/aledjones/spotigram/cmd"
|
import "github.com/aledjones/spotigram/cmd"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
|
|||||||
Reference in New Issue
Block a user