Tar or Zip support for download album

Linux related discussion about netjukebox
Locked
ix6tech
User
Posts: 48
Joined: Thu Jun 01, 2006 6:09 pm
Location: Dallas, TX
Contact:

Tar or Zip support for download album

Post by ix6tech »

I am wondering if there is a functional tar, or zip facsimile in linux (RHEL/CentOS) to using "7za a -tzip -mx0 -- %destination @%list" to utilize the download album function.

Yes, I am aware that simply installing p7zip would simplify this process, however, p7zip will not be an option for the server I am implementing this for.

Thank you,

Chris
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Tar or Zip support for download album

Post by wbartels »

I have found a working zip solution on Ubuntu.
This should also work on RHEL/CentOS.

Code: Select all

$cfg['download_album_cmd']          = 'cat %list' . ' | ' . $cfg['bin_dir'] . 'zip --junk-paths -0 %destination -@';
Please do some intensive testing and let me know if it also works for you?
If there are no problems I will add both config setting to the upcoming netjukebox with something like:

Code: Select all

//  +------------------------------------------------------------------------+
//  | Download album (with 7-Zip or zip)                                     |
//  +------------------------------------------------------------------------+
//  | http://www.7-zip.org                                                   |
//  |                                                                        |
//  | 7za uses the LANG envirement variabale, normaly this is only set when  |
//  | PHP is running in CLI mode.                                            |
//  +------------------------------------------------------------------------+
//  | http://www.info-zip.org/                                               |
//  |                                                                        |
//  | For zip the LANG envirement variabale is not needed.                   |
//  | And can be set to an empty string:                                     |
//  | $cfg['download_album_env_lang'] = '';                                  |
//  +------------------------------------------------------------------------+
$cfg['download_album_mime_type']	= 'application/zip';
$cfg['download_album_env_lang']     = 'en_US.UTF-8';
$cfg['download_album_extension']    = 'zip';
$cfg['download_album_cmd']          = $cfg['bin_dir'] . '7za a -tzip -mx0 -- %destination @%list';
// $cfg['download_album_cmd']          = 'cat %list' . ' | ' . $cfg['bin_dir'] . 'zip --junk-paths -0 %destination -@';
ix6tech
User
Posts: 48
Joined: Thu Jun 01, 2006 6:09 pm
Location: Dallas, TX
Contact:

Re: Tar or Zip support for download album

Post by ix6tech »

This works perfectly! I also tested it using a .tar format, and the results are extremely fast for archiving.

Thank you,

Chris
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Tar or Zip support for download album

Post by wbartels »

ix6tech wrote:This works perfectly! I also tested it using a .tar format, and the results are extremely fast for archiving.

Thank you,

Chris
Thanks for the feedback!
With the settings below it creates a tar file.
However it also add the complete directory structure.
I'm now looking for a command similar to --junk-paths from zip.

Code: Select all

$cfg['download_album_mime_type']    = 'application/x-tar';
$cfg['download_album_env_lang']     = '';
$cfg['download_album_extension']    = 'tar';
$cfg['download_album_cmd']          = 'tar --create --file %destination --files-from %list';
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Tar or Zip support for download album

Post by wbartels »

I have changed the netjukebox code so that it will first change the to the cache directory.
And create a list file with relative file names.
This way --junk-paths or the tar counterpart is not needed anymore.
ix6tech
User
Posts: 48
Joined: Thu Jun 01, 2006 6:09 pm
Location: Dallas, TX
Contact:

Re: Tar or Zip support for download album

Post by ix6tech »

Excellent. This should make switching archive methods easier.
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Tar or Zip support for download album

Post by wbartels »

wbartels wrote:I have changed the netjukebox code so that it will first change the to the cache directory.
And create a list file with relative file names.
This way --junk-paths or the tar counterpart is not needed anymore.
Sorry this modification doesn't work for source files (without transcoding).
So I have to revert the code.
7-Zip and zip (with --junk-paths) can still be used.
Locked