Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
importing songs
tallguy1404



Joined: 12 Jan 2011
Posts: 7

Posted: 01/31/11 10:27 
I have 1000+ songs I need to get working in jamroom from another non-jamroom site and could use some help.

what I did was write a script on the old server to put the songs, an ini for each song, and a cover image for an album into the samples folder under the band_id as well as output the sql to add it to the song_info table. Then I copied over the folder and added the songs to the database.

The problems I'm having are that it's not showing album art with the song, the songs aren't playing, and the songs don't show up anywhere but on the ?t=music page, meaning not under the artist.

I know the songs are there, as well as the image. I don't know why they're not showing up or playing. I've looked at the image.php hoping to figure out where it's looking for the song image, but it's way over my head, and I don't know where to start looking to get it to play or show up on the artists' pages.

Any help would be appreciated.

Here's the sql insert code I'm using for one of the songs:

Code

INSERT INTO um_jamroom.jamroom_song_info (song_id,band_id,song_time,song_update,song_show,song_order,song_name,song_album,song_label,song_genre,song_credits,song_advise,song_isrc,song_alicense,song_slicense,song_lyrics,song_history,song_comments,song_position,song_pos_date,song_vault_id,song_image_time,song_image_name,song_image_type,song_image_size,song_image_height,song_image_width,song_image_extension,song_comment_count,song_rating_1,song_rating_2,song_rating_3,song_rating_4,song_rating_5,song_rating_average,song_rating_number,hifi_time,hifi_update,hifi_name,hifi_type,hifi_size,hifi_download,hifi_extension,hifi_bitrate,hifi_smprate,hifi_length,hifi_seconds,hifi_orig_extension,hifi_scount,hifi_dcount,hifi_scount_total,hifi_dcount_total,lofi_time,lofi_update,lofi_name,lofi_type,lofi_size,lofi_download,lofi_extension,lofi_bitrate,lofi_smprate,lofi_length,lofi_seconds,lofi_orig_extension,lofi_scount,lofi_dcount,lofi_scount_total,lofi_dcount_total,spot_count,spot_count_total, song_count_date) VALUES (null,'11','1296488777','1296488777','yes','0','It's On (Feat. Ike Chil)','','','16','','no','','','','',' ','yes','0','1296488777','0','1296488777','album_58_Drilla_cover.jpg','image/jpeg','13637','200','2','jpg','0','0','0','0','0','0','0','0','1296488777','1296488777','drilla-02.mp3','audio/mpeg','1920940','no','mp3','32','24000','2:00','0','0','0','0','0','0','0','0','','','0','no','','','','','0','','0','0','0','0','0','0','1296488777')


Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/31/11 15:06 
You'll need to make sure that you've copied all of the media (songs/images) from your other site into the correct Jamroom directory for the artist the music is for, and that it is named properly.

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
tallguy1404



Joined: 12 Jan 2011
Posts: 7

Posted: 01/31/11 15:08 
What are the naming rules?
just
song_1.jpg
song_1.mp3
song_1.ini

or is it something else?

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 01/31/11 19:16 
You will want to checkout the getMediaFile function - it lays out all of the formats you'll need.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
tallguy1404



Joined: 12 Jan 2011
Posts: 7

Posted: 02/01/11 09:33 
This one?

http://www.jamroom.net/Function_jrMediaGetFile

I checked that page and the code for the function and wasn't able to learn anything about the naming scheme from it... likely due to my limited knowledge of php... it does sound like I should be using it when moving the files over, but I'm not sure when since I was just ftp uploading them.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/01/11 20:38 
You want this one:

http://www.jamroom.net/Function_getMediaFile

It's the precursor to jrMediaGetFile. This is the relevant code from that function that will tell you the filenames:


Code
switch ($type) {
        case 'band_image':
            $imp_id = 'image_import';                  // name from HTML form
            $fil_id = 'band_image';                  // used in SQL Queries
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/{$band_id}_image";   // file name (without extension)
            $arr_tg = 'image';                     // used in the $_FILES array
            $mod_dr = "{$config['artist_dir']}/{$band_id}";         // Directory located in
            break;
        case 'radio_image':
            $imp_id = 'image_import';
            $fil_id = 'radio_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/radio_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'channel_image':
            $imp_id = 'image_import';
            $fil_id = 'channel_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/channel_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'calendar_image':
        case 'event_image':
            $imp_id = 'image_import';
            $fil_id = 'calendar_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/event_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'photo_image':
            $imp_id = 'image_import';
            $fil_id = 'photo_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/photo_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'item_image':
            $imp_id = 'image_import';
            $fil_id = 'item_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/item_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'message_image':
            $imp_id = 'image_import';
            $fil_id = 'message_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/message_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'song_image':
            $imp_id = 'image_import';
            $fil_id = 'song_image';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'song_hifi':
            $imp_id = 'hifi_import';
            $fil_id = 'song_hifi';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/{$match_id}_hifi";
            $arr_tg = 'hifi';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'song_lofi':
            $imp_id = 'lofi_import';
            $fil_id = 'song_lofi';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/{$match_id}_lofi";
            $arr_tg = 'lofi';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'video':
            $imp_id = 'video_import';
            $fil_id = 'video_file';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/{$match_id}_video";
            $arr_tg = 'video';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'video_image':
            $imp_id = 'image_import';
            $fil_id = 'video_image';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/video_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'vault_file':
            $imp_id = 'vault_import';
            $fil_id = 'vault_file';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/vault_{$match_id}";
            $arr_tg = 'vault_file';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'vault_image':
            $imp_id = 'image_import';
            $fil_id = 'vault_image';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/vault_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;
        case 'user_image':
            $imp_id = 'image_import';
            $fil_id = 'user_image';
            $fil_nm = "{$jamroom['band_dir']}/{$band_id}/user_{$match_id}_image";
            $arr_tg = 'image';
            $mod_dr = "{$config['artist_dir']}/{$band_id}";
            break;
        case 'file':
            $imp_id = 'file_import';
            $fil_id = 'file';
            $fil_nm = "{$jamroom['song_dir']}/{$band_id}/file_{$match_id}";
            $arr_tg = 'file';
            $mod_dr = "{$config['song_dir']}/{$band_id}";
            break;


Particularly the $fil_nm variable - i.e. a hifi song should be named #_hifi.mp3 (where # is the new song_id, and .mp3 is the extension), and placed in the jamroom/media/# directory (where # is the band_id).

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...

Last edited by smith.kyle on 02/01/11 20:39; edited 1 time in total
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/01/11 20:39 
You might look into the Jukebox as well - I think it does what you're looking to do:

http://www.jamroom.net/Jamroom4_Jukebox_Features

As long as the media files are tagged correctly, I think it's what you want...

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.