Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1

    DatabaseQuery and bash scripting

    I'm a very happy user of the Database Query plugin, still clinging to LMS 7.9, but everything works so perfectly

    I wonder if there is a possibilty to use the queries I've built from outside the LMS UI via a bash script.

  2. #2

    DatabaseQuery and bash scripting (c'ted)

    Quote Originally Posted by tuxEvangelist View Post
    I'm a very happy user of the Database Query plugin, still clinging to LMS 7.9, but everything works so perfectly

    I wonder if there is a possibilty to use the queries I've built from outside the LMS UI via a bash script.
    I've tried fiddling around with wget or curl, but right now a command like

    Code:
    wget -o ~/Downloads/1.csv http://nas-box:9000/plugins/DatabaseQuery/databasequery_executedataquery.binfile?type=01-testTrackPaths&as=csv&player=0071%3A04%3A20%3A1f%3A09%3A73
    leads to nowhere but a file saying "Waiting for server..." which never finishes and eventually sends the server looping.

    What I'd like to do in the above example is execute query "01-testTrackPaths" on the server and save the result in .csv format to "~/Downloads/1.csv".

    Is there a simple way to do that?

    Thanx a ton!

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,665

    DatabaseQuery and bash scripting

    > I wonder if there is a possibilty to use the queries I've built from
    > outside the LMS UI via a bash script.


    Are the queries SQL?

  4. #4
    Quote Originally Posted by mherger View Post
    > I wonder if there is a possibilty to use the queries I've built from
    > outside the LMS UI via a bash script.


    Are the queries SQL?
    Yes sure. They're just wrapped inside the XML that is stored by the Database Query plugin, looks like that:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <databasequery>
    	<template>
    		<id>sqlquery.xml</id>
    		<parameter type="text" id="queryname"><value>01-testTrackPaths</value></parameter>
    		<parameter type="text" id="querydescription"></parameter>
    		<parameter type="text" id="querysql" rawvalue="1"><value>-- URLs ausgeben, von Zufallsmix ausgeschlossene Genres
    --
    select distinct url
    from genre_track
    inner join tracks on
    (
    genre_track.track = tracks.id
    )
    inner join genres on
    (
    genre_track.genre = genres.id
    )
    where
    genres.name not in
    (
    &quot;Giftschrank&quot;,
    &quot;Werbung&quot;
    )
    --LIMIT 20
    ;;
    </value></parameter>
    	</template>
    </databasequery>
    AND: Good question, I have an idea where you are pointing me to: Avoid the overhead of the Database Query plugin completely and query against the database directly via SQLite client, right?

    Is there a good starting point in the Wiki somewhere for that approach?

  5. #5
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,665

    DatabaseQuery and bash scripting

    > AND: Good question, I have an idea where you are pointing me to: Avoid
    > the overhead of the Database Query plugin completely and query against
    > the database directly via SQLite client, right?


    Exactly.

  6. #6
    Quote Originally Posted by mherger View Post
    > AND: Good question, I have an idea where you are pointing me to: Avoid
    > the overhead of the Database Query plugin completely and query against
    > the database directly via SQLite client, right?


    Exactly.
    Hmm... well, the LMS sits on a NAS box which is not accessible by ssh. As I've learned recently SQLite has zero networking DB options unlike MySQL.

    So looks like unfortunately I'm stuck again here. Any other ideas?

    Thanx already in advance

  7. #7
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,665

    DatabaseQuery and bash scripting

    > Hmm... well, the LMS sits on a NAS box which is not accessible by ssh.
    > As I've learned recently SQLite has zero networking DB options unlike
    > MySQL.


    What NAS would allow you to install LMS but not provide SSH access?

  8. #8
    Quote Originally Posted by mherger View Post
    > Hmm... well, the LMS sits on a NAS box which is not accessible by ssh.
    > As I've learned recently SQLite has zero networking DB options unlike
    > MySQL.


    What NAS would allow you to install LMS but not provide SSH access?
    Aah, that's the day of tight questions... Caught red-handed :-D

    I HAD SSH access but being dumb enough to try to gain non-root access I've managed to lock myself out completely.
    BTW it's a NetGear ReadyNAS Duo v2 that really comes with no SSH out of the box. There's only a side-option via direct .bin installation, which works but unfortunately cannot be uninstalled or reset via the admin UI. Re-installing also did not help to reset the SSH configuration.

    So I'm trying to regain the SSH option in parallel, but of course I don't wanna waste anyone's time here with that sort of thing.

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,665

    DatabaseQuery and bash scripting

    > So I'm trying to regain the SSH option in parallel, but of course I
    > don't wanna waste anyone's time here with that sort of thing.


    And if you wanted to save some of your own time, too, I'd recommend you
    get a Raspberry Pi to run LMS on... I've been using a Duo v2 myself for
    many years. But LMS never was fun. Using pCP on a Pi3B was so much
    smoother and easier to deal with!

  10. #10
    And if you wanted to save some of your own time, too, I'd recommend you
    get a Raspberry Pi to run LMS on... I've been using a Duo v2 myself for
    many years. But LMS never was fun. Using pCP on a Pi3B was so much
    smoother and easier to deal with![/QUOTE]

    That's really spot-on, because I'm starting to think harder about my migration path these days The day Firefox drops TLS 1.0/1.1 finally I'm left with a headless NAS.

    I'm very interested in some more details of your configuration, if you don't mind:
    -main memory
    -disks used
    -any additional hardware necessary (raid controller etc.)?
    -FreeNAS/TrueNAS or what kind of software

    Thanks a lot!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •