Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin won't initiate download if the downloading has been intiated once #19

Open
bhavin2707 opened this issue Jul 21, 2021 · 1 comment

Comments

@bhavin2707
Copy link

Hi, so I was developing a puzzle game that uses this plugin as it's a perfect fit. I am downloading the images from google drive at runtime. In the many, I have a script to download the levels sequentially in the background, but the problem occurs when I change the scene, and when I come back, the plugin just won't download the levels. it gets stuck where it was left off. This breaks the flow of downloading the levels and to continue, have to restart the app.

Any suggestions on how to fix it?

@ReneB
Copy link

ReneB commented Nov 8, 2022

FWIW, I think I've locally fixed this by adding an OnDestroy() method to the Davinci.cs file, like this:

    private void OnDestroy()
    {
        if (underProcessDavincies.ContainsKey(uniqueHash) && underProcessDavincies[uniqueHash] == this) {
            if (enableLog)
                Debug.Log("[Davinci] Removing Davinci object while download unfinished: " + uniqueHash);

            underProcessDavincies.Remove(uniqueHash);
        }
    }

I have not yet been able to test this outside of our own use case, where it seems to fix an issue similar to that of @bhavin2707, but I think I understand the code well enough to determine that the code above makes sure that the Davinci instance being destroyed is the one that any other possible Davinci instances that were waiting for the same file have set their hopes on for getting the file, so if this one is being Destroy()ed, no other Davinci instance should be registered for this specific uniqueHash anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants