airdcpp / airdcpp-windows

http://www.airdcpp.net
GNU General Public License v3.0
80 stars 19 forks source link

Can't open file list if user name is not included #49

Closed RomanV0703 closed 1 year ago

RomanV0703 commented 4 years ago

Tried to open an xml file list (basically just a list of files in a single directory) in different DC clients; FlylinkDC for example opens such files without a problem and allows to queue all the files in said directory for download; AirDC, on the other hand, for a reason unclear to me insists on including a name of a user into file list's name; therefore I can't open 'simple' lists (not complete list of files of a single user), instead encountering an error _INVALIDLISTNAME.

I guess, code below is responsible for this behavior:

MainFrm.cpp

LRESULT MainFrame::onOpenFileList(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
    tstring file;
    if (WinUtil::browseList(file, m_hWnd)) {
        UserPtr user = DirectoryListing::getUserFromFilename(Text::fromT(file));
        if (user) {
            DirectoryListingFrame::openWindow(HintedUser(user, Util::emptyString), Text::fromT(file));
        } else {
            WinUtil::showMessageBox(TSTRING(INVALID_LISTNAME), MB_ICONWARNING);
        }
    }
    return 0;
}
maksis commented 4 years ago

Yeah, it's intended behavior.

therefore I can't open 'simple' lists (not complete list of files of a single user)

From where do you get those?

RomanV0703 commented 4 years ago

From where do you get those?

Just created one myself. Also Flylink can generate file lists for directories (with dclst extension if I remember correctly, but basically same old xml.bz2).

Also just tried renaming file list to [name].[39_random_characters].xml — works fine this way.

maksis commented 4 years ago

I'd say that it's a good practice to have some kind of display name for such filelists. Showing "39 random characters" as the filelist title doesn't look good.

RomanV0703 commented 4 years ago

That's not the point. Why does AirDC treat all file lists like user file lists, while other DC-clients can open file lists consisting of, say, a single directory or a bunch of files? Seems like an issue to me.

maksis commented 4 years ago

Why does AirDC treat all file lists like user file lists, while other DC-clients can open file lists consisting of, say, a single directory or a bunch of files?

I'm not totally sure if I understand the problem. I thought that you were able to open the list if the filename was in a correct format. [username].[CID].xml should be the standard format for filelists saved by DC++-based clients. If there's a DC++-based client that is not using that format, then I'm not aware of that. If you need to create such filelists by yourself, including some kind of "user name" should be easy.

RomanV0703 commented 4 years ago

[username].[CID].xml should be the standard format for filelists

It's a standard format for user filelists (lists of files of a single user).

What if I'm just sharing a single directory or a bunch of files? I can use magnets, sure. But if I'm sharing, say, a hundred files? Usually I will not share a hundred magnets, but create a file list with hashes instead. What username and what CID should I put then? And the most important question — why?

maksis commented 4 years ago

I think that the key is that AirDC++ only supports filelists that are linked to a user (which isn't only about having the user in the filename).

Which clients have you tested that allow opening filelists with any filename?

ps. you might also want to read https://www.airdcpp.net/forum/viewtopic.php?f=6&t=1112