Skip to content

Commit

Permalink
Merge pull request #107 from eschizoid/bugifx/105
Browse files Browse the repository at this point in the history
Fix for #105
  • Loading branch information
eschizoid authored Nov 27, 2018
2 parents 56ec1eb + 0166aa3 commit e40e241
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ flixctl
/aws/lambda/plex/dispatcher/lambda.zip
/aws/lambda/plex/executor/lambda.zip
/aws/lambda/torrent/lambda.zip
/aws/lambda/torrent/library.zip
/aws/lambda/library/lambda.zip

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
Expand Down
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Available Commands:
start To Start Plex
status To Get Plex Status
stop To Stop Plex
token To Get Plex Token
Flags:
-h, --help help for plex
Expand All @@ -112,6 +113,7 @@ Use "flixctl plex [command] --help" for more information about a command.
----
$ flixctl library --help
To Control Media Library
Usage:
flixctl library [command]
Expand Down Expand Up @@ -153,6 +155,7 @@ flixctl version
----
==== ```flixctl plex```
----
flixctl plex token
flixctl plex start --slack-notification "true" --slack-notification-channel "monitoring"
flixctl plex stop --slack-notification false
flixctl plex status --slack-notification false
Expand Down
14 changes: 0 additions & 14 deletions cmd/torrent/download.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package torrent

import (
"encoding/base64"
"encoding/json"
"fmt"
"os"

sess "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
Expand All @@ -20,18 +18,6 @@ var DownloadTorrentCmd = &cobra.Command{
Short: "To Download A Torrent",
Long: "to download a torrent using Transmission client.",
Run: func(cmd *cobra.Command, args []string) {
envMagnetLink := os.Getenv("MAGNET_LINK")
envDownloadDir := os.Getenv("DOWNLOAD_DIR")
if envDownloadDir != "" && envMagnetLink == "" {
// coming from web-hook
downloadDir = envDownloadDir
decodedEnvMagnetLink, err := base64.StdEncoding.DecodeString(envMagnetLink)
if err != nil {
fmt.Printf("Could not decode the magnet link: [%s]\n", err)
panic(err)
}
magnetLink = string(decodedEnvMagnetLink)
}
var awsSession = sess.Must(sess.NewSessionWithOptions(sess.Options{
SharedConfigState: sess.SharedConfigEnable,
}))
Expand Down
8 changes: 0 additions & 8 deletions cmd/torrent/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package torrent
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"

Expand All @@ -17,13 +16,6 @@ var SearchTorrentCmd = &cobra.Command{
Short: "To Search For Torrents",
Long: "to search for torrents using the given keyword(s)",
Run: func(cmd *cobra.Command, args []string) {
envKeywords := os.Getenv("KEYWORDS")
envDownloadDir := os.Getenv("DOWNLOAD_DIR")
if envKeywords != "" && envDownloadDir != "" {
// coming from web-hook
keywords = envKeywords
downloadDir = envDownloadDir
}
torrentSearch := torrentService.Search{
In: keywords,
SourcesToLookup: []string{
Expand Down
2 changes: 1 addition & 1 deletion hooks/torrent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ case $# in
/home/webhook/go/bin/flixctl torrent \
download \
--download-dir "${DOWNLOAD_DIR}" \
--magnet-link "${MAGNET_LINK}" \
--magnet-link "$(echo `echo "${MAGNET_LINK}" | base64 --decode`)" \
--slack-notification-channel "${SLACK_TORRENT_INCOMING_HOOK_URL}"
;;
search)
Expand Down

0 comments on commit e40e241

Please sign in to comment.