Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./musicsync --spotify-apicode produces no output #23

Closed
floflunse opened this issue Dec 14, 2020 · 4 comments
Closed

./musicsync --spotify-apicode produces no output #23

floflunse opened this issue Dec 14, 2020 · 4 comments

Comments

@floflunse
Copy link

Good evening,
thanks a lot for this great project!
I managed to compile musicsync in my WSL Ubuntu 18.04 environment without any error.
However, when it comes to connecting it to Spotify there seems to be an issue.
That is, calling `./musicsync --spotify-apicode´ just produces the standard output:

`Usage: spotify-toniebox-sync.jar [--daemon | --input INPUT --output OUTPUT]
--daemon
Run in daemon mode to sync periodically all lists in the properties file
--input INPUT
Define an input source for a one-time run
--output OUTPUT
Define an output destination for a one-time run

Input Plugins:
--spotify-apicode
Generate an API Code URL to get attach Application to Spotify Account
--spotify-code CODE
Generate a Refresh token out of the Spotify Code

Output Plugins:
--toniebox-username USERNAME
Set the Toniebox username to login to Toniebox
--toniebox-password PASSWORD
Set the password for the Toniebox user for login
--filesystem-directory DIRECTORY
Set the output path for the files`

No error and the logfile is empty as well.
I followed the instructions carefully and checked it several times...
Do you know about this issue?

Kind regards

Florian

@cg-laser
Copy link

I think this is the same error that I'm also getting #22

@floflunse
Copy link
Author

@cg-laser Thanks for your immediate response!
Yes, sounds pretty similar.

My Java version is identical with yours:
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)

Maybe its interesting to you that my musicsync script already was executable...

@floflunse
Copy link
Author

floflunse commented Dec 15, 2020

I tracked back the issue and found the root cause in the parseArguments method in the Application.java

https://github.com/maximilianvoss/spotify-toniebox-sync/blob/da17628f99ce711fa8b66c992029168086b346ec/application/src/main/java/rocks/voss/musicsync/Application.java#L121

That is, if no --input --output is specified, and the daemon is turned off as well, the parser complains and will not call the parser methods of the plugins.
Inserting another "else if" statement before the else in line 121 which returns true does the trick!

else if (!isDaemon && StringUtils.isEmpty(argInputUri) && StringUtils.isEmpty(argOutputUri)) {
            log.debug(("No input and output specified. Parameters will be passed to plugin parsers.");
            return true;
        }

@maximilianvoss maybe you can check, whether this has any undesired side-effects and then fix it...

@cg-laser
Copy link

Thanks @floflunse to mention this fix. I found out one thing that might be good to add to the documentation: The spotify redirect URI also needs to be the same as specified on the "spotify app" that I creased on developers.spotify.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants