fedorablewill / ptu-tools

PokéSheets: A Pokemon Generator/Manager for Pokemon Tabletop United v1.05
3 stars 3 forks source link

Select Files from Shared Google Drive #82

Open JESchoett opened 1 year ago

JESchoett commented 1 year ago

All the Players in our Campaign organize the Pokémon in a Shared Google Drive, but even when everybody is Allowed to Edit saved Pokémon, you are only allowed to open Owned Files in the Picker object. If you should decide to edit this, is it possible to show the Folder Organization? So I could choose for example: /SharedFolder/Player1/Box/Rattatar

And it would be awesome if you could open all the Pokémon in a Folder.

fedorablewill commented 9 months ago

Sorry for taking so long to get back!

I've not experienced this issue with not being able to edit other files. I've had my players edit files I've shared with them all the time. Can you include a screenshot from Google Drive on what privileges you've given your players for the file in question?

The file opener is controlled by Google, I'm using their technology for that. I can see what other options I have with them, but it was very limited. As a workaround, you can give prefixes to each of the file names, such as the initials of the character/player that owns the pokemon, which makes searching and finding them way easier. Though I do agree that viewing by folder is the better option.

Opening multiple at once is a planned feature, and a highly requested one that I wish to develop, but will take a lot of time and effort which I don't have yet. See https://github.com/fedorablewill/ptu-tools/milestone/2

JESchoett commented 9 months ago

Thank you for your answer! image image So I can see all the Pokémon that I Uploaded

But here is for example the Box of another Player: image image

If I need to open a Pokémon that has the Prefix HD, I would need to download it first. But the Folders "HD" and "JE" are in the same shared Drive: image and I am not the owner of those Folders: image

JESchoett commented 4 months ago

Using the Google Drive API, I created a Python Script that solves this issue by opening all the Pokémon in the Folder of a Player. After the authentication, you can get all the File IDs from a Folder. The ID is then used to open the pokesheets.app "https://pokesheets.app/pokemon/drive/", however I needed to create a developers.google.com account. To get the folderId I added the get_folder_id_by_name() function: https://github.com/JESchoett/pokesheets_open_folder/blob/main/main.py

fedorablewill commented 4 months ago

Nice!!! However, I've barely used Python before and I can't directly integrate that here 😅. I can try to adapt your logic into Kotlin or JavaScript once I eventually get enough free time to work on such.