• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Internal: file hash
#6
Oh sorry, I was confused as to what you were talking about. Those are the Google Drive File ids that Google Drive assigns when I upload a file. There is no algorithm to map the folder names to the ID. If I have a path with multiple levels, say root/folder1/folder2/file, then I have to first retrieve the root, then do a query for folder1 by name, then after I get that object with a proper ID, I can query for folder2 by name, then using the ID returned for that I can get the file. Google Drive doesn't support a concept of hierarchical paths like Dropbox (or any normal file system), so there is no way around that. To speed things up, I cache access to folders once I retrieve them.  

In the hash file you are seeing the ID of the folder that owns each file. I just save that path in the database stored on Google Drive so that it simplifies the processing. All files/folders are relative to the storage location (which is set to the selected sync folder containing the database file), so I can easily compare the files/folders on the device against what is on Google Drive so long as the files on the device are also relative to the storage location. When it comes to finding matching songs and files, the logic has gotten a little complex, as I'll compare file names along with song IDs, and if I get multiple matches then that dialog is shown to ask the user to pick the right one.

Mike
Reply


Messages In This Thread
Internal: file hash - by sciurius - 07-29-2018, 10:14 PM
RE: Internal: file hash - by Zubersoft - 07-30-2018, 02:33 AM
RE: Internal: file hash - by sciurius - 08-01-2018, 08:13 PM
RE: Internal: file hash - by Zubersoft - 08-02-2018, 12:46 AM
RE: Internal: file hash - by sciurius - 08-02-2018, 12:57 AM
RE: Internal: file hash - by Zubersoft - 08-02-2018, 03:44 AM
RE: Internal: file hash - by sciurius - 08-02-2018, 04:12 AM
RE: Internal: file hash - by sciurius - 08-02-2018, 06:17 AM
RE: Internal: file hash - by Zubersoft - 08-02-2018, 07:00 AM
RE: Internal: file hash - by sciurius - 08-02-2018, 08:14 AM
RE: Internal: file hash - by Zubersoft - 08-02-2018, 04:41 PM
RE: Internal: file hash - by sciurius - 08-08-2018, 07:30 PM
RE: Internal: file hash - by Zubersoft - 08-09-2018, 02:33 AM
RE: Internal: file hash - by sciurius - 08-09-2018, 06:35 AM



Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2025 MyBB Group.