• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Help with all songs in DB report

Started by mitchrapp, December 05, 2022, 08:26:13 AM

mitchrapp

I hate to admit this, I have sent to csv all songs in the database multiple times. Maybe I am tired, but I can't seem to remember how I did it. 

I am after every song in the DB and /or can ball "ALL" setting with no filters.  How many times played would be nice but isn't necessary.   

I am often lame, this is lame of me after so long to have to ask.
RadioDJ 2017, Multiple Live On Air Personality gigs each week.

Kiwi

I'm not totally up on all of this, but would you not use the "Export" command in MySql and export to a csv file?

stevewa

in HeidiSQL

select your database in left window pane

File > New Query Tab

SELECT *
INTO OUTFILE "C:\\Users\\Public\\Documents\\RDJ_Songs.csv"
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM songs
;


count_played is a column in songs table, so the results will include that

to get a list of columns of the table into a file, run this query separately:

-- override GROUP_CONCAT limit of 1024 characters to avoid a truncated result
set session group_concat_max_len = 1000000;

select GROUP_CONCAT(CONCAT('"',COLUMN_NAME,'"'))
INTO OUTFILE "C:\\Users\\Public\\Documents\\RDJ_Songs_ColumnNames.csv"
from INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'songs'
AND TABLE_SCHEMA = 'radiodj2' -- database name
order BY ORDINAL_POSITION


note that if the outfile already exists, SQL will show error.
so move or delete the outfile from disk before running the queries.

mitchrapp

#3
Steve and Kiwi, I will look into attempting through HeidiSQL...  However, there is a way to get this report from inside of RadioDJ I have done it multiple times. Sadly my memory sometimes can't seem to remember stuff I don't do regularly.  It's not a custom thing either...

UPDATE:  I found it,  is using Library in reports... However, something has changed, I have these reports going back several years, and the original were like the one below, did NOT include "GENRE".. but I have 2 years that did include "GENRE" so must have been one of the RDJ version changes... but lost in last update v2.0.0.6 update..  If one of you Wiz guys can add "genre" back into that All music or "All types"  full library dump.  that would be fantastic :)

https://i.gyazo.com/2c95d8fc0b98e65d8f66cf022f0cc738.png
RadioDJ 2017, Multiple Live On Air Personality gigs each week.

stevewa

Maybe you are thinking of the history report I made for you back in Nov 15 , 2021 ?

It had a cross reference to the Genres table so that did show in the history report.

Jhonny

Started  with radiodj  0.1.5.8..
Now on::
RadioDj v 2.0.4.5
With.
MariaDB v 11.6.1 server (crappy)
Got back to.
MariaDB v 10.5 (64) server
Scripting test server:
wampserver3.3.6 (x64) with PHP 8.4.2

mitchrapp

Quote from: stevewa on December 06, 2022, 10:25:38 PM
Maybe you are thinking of the history report I made for you back in Nov 15 , 2021 ?

It had a cross reference to the Genres table so that did show in the history report.

Yeah, I thought so too Steve, and like you I checked the date.. 
https://i.gyazo.com/e9ee4ef8d2b9472a03ef6e8138d00434.png
The curious thing is ID# is missing, but I could have deleted that column because I didn't need it for my purposes, but Genre was there for sure and not in 2019
RadioDJ 2017, Multiple Live On Air Personality gigs each week.

stevewa