BlafKing / sd-civitai-browser-plus

Extension to access CivitAI via WebUI: download, delete, scan for updates, list installed models, assign tags, and boost downloads with multi-threading.
GNU Affero General Public License v3.0
309 stars 53 forks source link

[Bug]: Permission indicator wrong #158

Closed haoling closed 9 months ago

haoling commented 9 months ago

Describe the bug.

Permission indicator in model description is wrong allow or deny icon.

ex: The "allowCommercialUse" field in the model "256634" (SunnySpectrum (NSFW Mix))'s REST response is "Rent", permission indicator shows "cannot sell image they generated". but the indicator in CivitAI's page is "Allow sell images they generate".

Steps to reproduce the problem.

  1. Go to CivitAI Browser+ tab.
  2. Search "https://civitai.com/models/256634".
  3. Click the model thumbnail.
  4. See permission indicator, Sell images they generated.
  5. You can see it is "Deny".
  6. Click model name in title, and go to CivitAI page.
  7. See permission indicator, Sell images they generated.
  8. You can see it is "Allow".

Expected behavior

In CivitAI's source code, canSellImages variable is True when allowCommercialUse is wither of one: Image, Rent, RentCivit, Sell. https://github.com/civitai/civitai/blob/028622de94c9ea5e2aefd11b91320a5875a83de8/src/components/PermissionIndicator/PermissionIndicator.tsx#L16

But in Browser+'s code, shows allow icon for "Sell images they generate" only when allowCommercialUse is "Image". https://github.com/BlafKing/sd-civitai-browser-plus/blob/15b2f66ebce03562f17889bbd673877fdb862592/scripts/civitai_api.py#L794

System info

Console logs

No console logs when click model thumbnail.

Additional information

I am Japanese. Sorry for bad english.

BlafKing commented 9 months ago

Thanks for letting me know! (and no worries, your english is great 😄)

I see now that I incorrectly set 3 permission, being the "Sell images", "Run on services" and "Run on Civitai" permissions. This has now been fixed in the latest hotfix!

Also thanks for providing the source code from CivitAI! I haven't seen that before and it made it much easier to replicate exactly what CivitAI does, so it should now correctly show the permissions :)

I'll go ahead and close this bug report since it should be fixed!

haoling commented 9 months ago

Thank you for hotfix! I confirmed to permission display was fixed. I am happy for helpful to you, and your fast hotfix.