Skip to content

Downloading from built-in Nexus Files tab silently fails — initModInfo requires NXM URL that is never set #261

@thrik

Description

@thrik

Description:

Downloading mods from the built-in Nexus page Files tab silently fails for all mods, all games. The log shows only "Download failed" with no error details and no error popup appears.

Steps to reproduce:

  1. Set up NexusMods API key (shows valid, premium)
  2. Right-click any mod → Show Nexus Page → Files tab
  3. Click the download button on any file
  4. "Download failed" in log, no error popup

Environment:

  • Limo v1.2.2 (Flatpak, Flathub)
  • Fedora 43, KDE Wayland
  • NexusMods Premium account, API key confirmed working via curl

Root cause (source analysis of v1.2.2):

The Files tab download path in mainwindow.cpp:3244 (onModDownloadRequested) sets info.remote_file_id and info.remote_source but does not set info.remote_request_url — it stays at its default value of "" (importmodinfo.h:63).

In applicationmanager.cpp:938, since remote_request_url is empty, the first branch is taken and getDownloadUrl(remote_source, remote_file_id) is called. This succeeds — the CDN download URL is obtained and stored in info.remote_download_url (line 949).

However, on line 965, Api::initModInfo(info) is called. In api.cpp:339, this function immediately calls nxmUrlIsValid(info.remote_request_url). Since remote_request_url is empty, the regex at api.cpp:377 doesn't match, and initModInfo returns false on line 341 without throwing an exception.

Back in applicationmanager.cpp:966, !(*init_successful) evaluates to true, and downloadFailed() is emitted. Because no exception was thrown, handleExceptionsForFunction never calls sendError, so no error popup is shown — the failure is completely silent.

By contrast, the browser-based "Mod Manager Download" path (mainwindow.cpp:3224) does set info.remote_request_url to the NXM URL, so initModInfo succeeds and the download completes.

Summary: The CDN URL is successfully obtained but the download never executes because initModInfo unconditionally gates on an NXM URL that the Files tab never provides.

Suggested fix:

Add an alternate path at the top of Api::initModInfo for when remote_request_url is empty but remote_source and remote_file_id are already populated:

if(info.remote_request_url.empty() && modUrlIsValid(info.remote_source) && info.remote_file_id >= 0)
{
  auto files = getModFiles(info.remote_source);
  auto iter = str::find_if(files, [&info](File& f){ return f.file_id == info.remote_file_id; });
  if(iter == files.end())
    return false;
  auto domain_and_mod = extractDomainAndModId(info.remote_source);
  if(!domain_and_mod)
    return false;
  info.remote_mod_id = std::stol((*domain_and_mod).second);
  info.remote_file_name = iter->name;
  info.remote_file_version = iter->version;
  info.remote_type = ImportModInfo::RemoteType::nexus;
  return true;
}

Workaround: Use the "Mod Manager Download Link" to open the file in browser, then click "Mod Manager Download" on the NexusMods website. This uses the NXM URL path which works correctly.

Possibly related: #41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions