NO-ob / LoliSnatcher_Droid

A booru client with support for batch downloading
GNU Affero General Public License v3.0
392 stars 24 forks source link

[Feature Request] Favourites for Hydrus #93

Open GreenLandisaLie opened 2 years ago

GreenLandisaLie commented 2 years ago

Should be possible by adding a specific unique tag such as "lolinatcher_favourite" whenever an image is added to favourites. Then remove the tag if the image is removed from favourites. When searching for favourites lolisnatcher should look for images with that tag automatically.

This would be a simple implementation only useful for private hydrus client users ofc.

GreenLandisaLie commented 2 years ago

Favourites seem to work after these changes: 1) - making the postURL the same as fileURL (instead of empty) in the BooruItem creation of the HydrusHandler 2) - adding a check in the fromDBRow method within BooruItem.dart to force update the item.mediaType when the item is from an Hydrus database, like so:

if (row["fileURL"].toString().contains('Hydrus-Client')) {
    item.mediaType = row["mediaType"].toString();
}

3) - (same as 2) on the fromJSON method for LolySync:

if (json["fileURL"].toString().contains('Hydrus-Client')) {
  item.mediaType = json["mediaType"].toString();
}