• FileBase - Add to batch downloads?

    From Nightfox@DIGDIST to Digital Man on Wed Jan 26 09:31:35 2022
    Hi DM,

    Synchronet's JS object model has had bbs.batch_add_list() for a while now. With each file in the list, it has to search the whole file database to see if and where the file exists in the filebases.

    Now that there is a FileBase class, I'm wondering if it would make sense for the FileBase class to have a similar batch_add function, for files just within that filebase? I've been working on a lightbar file lister, and if the user wants to add one of the files in that filebase to their batch download queue, I was thinking it might make sense for the FileBase class to have its own batch_add function, so that Synchronet wouldn't have to search through all of the filebases for that file.

    If there already is such a function in the FileBase class, I'm not seeing it in the current documentation.. Maybe I missed it?
    http://www.synchro.net/docs/jsobjs.html#FileBase_class

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man to Nightfox on Wed Jan 26 13:59:48 2022
    Re: FileBase - Add to batch downloads?
    By: Nightfox to Digital Man on Wed Jan 26 2022 09:31 am

    Hi DM,

    Synchronet's JS object model has had bbs.batch_add_list() for a while now. With each file in the list, it has to search the whole file database to see if and where the file exists in the filebases.

    Now that there is a FileBase class, I'm wondering if it would make sense for the FileBase class to have a similar batch_add function, for files just within that filebase? I've been working on a lightbar file lister, and if the user wants to add one of the files in that filebase to their batch download queue, I was thinking it might make sense for the FileBase class to have its own batch_add function, so that Synchronet wouldn't have to search through all of the filebases for that file.

    If there already is such a function in the FileBase class, I'm not seeing it in the current documentation.. Maybe I missed it? http://www.synchro.net/docs/jsobjs.html#FileBase_class

    No, there isn't a per-base "add to batch download queue" method (yes, I could add one pretty easily). However, the batch lists are now just .ini files (for details, see https://wiki.synchro.net/history:newfilebase#batches), so adding/removing files to the queue from a JS module should be pretty trivial. I'm pretty sure you know the File class has methods for dealing with .ini files.
    --
    digital man (rob)

    Synchronet "Real Fact" #22:
    The second ever Synchronet BBS was the Mid-Nite Hacker BBS (sysop: The Zapper) Norco, CA WX: 69.7°F, 16.0% humidity, 3 mph NNW wind, 0.00 inches rain/24hrs
  • From Nightfox@DIGDIST to Digital Man on Wed Jan 26 15:37:40 2022
    Re: FileBase - Add to batch downloads?
    By: Digital Man to Nightfox on Wed Jan 26 2022 01:59 pm

    No, there isn't a per-base "add to batch download queue" method (yes, I could add one pretty easily). However, the batch lists are now just .ini files (for details, see https://wiki.synchro.net/history:newfilebase#batches), so adding/removing files to the queue from a JS module should be pretty trivial. I'm pretty sure you know the File class has methods for dealing with .ini files.

    It looks like the bbs.batch_add_list() function (which has been around since version 3.10) is able to add files to the user's batch download list, and it seems the file format it expects is just one filename per line. Are you recommending to no longer use bbs.batch_add_list() but to write an ini file instead?

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man to Nightfox on Wed Jan 26 17:07:15 2022
    Re: FileBase - Add to batch downloads?
    By: Nightfox to Digital Man on Wed Jan 26 2022 03:37 pm

    Re: FileBase - Add to batch downloads?
    By: Digital Man to Nightfox on Wed Jan 26 2022 01:59 pm

    No, there isn't a per-base "add to batch download queue" method (yes, I could add one pretty easily). However, the batch lists are now just .ini files (for details, see https://wiki.synchro.net/history:newfilebase#batches), so adding/removing files to the queue from a JS module should be pretty trivial. I'm pretty sure you know the File class has methods for dealing with .ini files.

    It looks like the bbs.batch_add_list() function (which has been around since version 3.10) is able to add files to the user's batch download list, and it seems the file format it expects is just one filename per line. Are you recommending to no longer use bbs.batch_add_list() but to write an ini file instead?

    Correct. If you want to add files fast, open the appropriate file (as mentioned in that wiki article) and add the file details.

    Or you can wait and I'll add a FileBase() method to do that for you, but it won't exist in v3.19b. Opening and updating the .ini file will work for v3.19b and future versions.
    --
    digital man (rob)

    Synchronet "Real Fact" #108:
    Weedpuller "Falling Star" http://youtu.be/J0ijOUT7KIw
    Norco, CA WX: 64.3°F, 20.0% humidity, 0 mph NNW wind, 0.00 inches rain/24hrs
  • From Nightfox@DIGDIST to Digital Man on Wed Jan 26 17:19:40 2022
    Re: FileBase - Add to batch downloads?
    By: Digital Man to Nightfox on Wed Jan 26 2022 05:07 pm

    line. Are you recommending to no longer use bbs.batch_add_list() but
    to write an ini file instead?

    Correct. If you want to add files fast, open the appropriate file (as mentioned in that wiki article) and add the file details.

    Or you can wait and I'll add a FileBase() method to do that for you, but it won't exist in v3.19b. Opening and updating the .ini file will work for v3.19b and future versions.

    I'll just have it open and update the .ini file.

    Thanks.

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com