{"action":"created","issue":{"url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/621","repository_url":"https://api.github.com/repos/Bionus/imgbrd-grabber","labels_url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/621/comments","events_url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/621/events","html_url":"https://github.com/Bionus/imgbrd-grabber/issues/621","id":178750357,"number":621,"title":"Command/Database Enhancements","user":{"login":"Siegen","id":7193803,"avatar_url":"https://avatars.githubusercontent.com/u/7193803?v=3","gravatar_id":"","url":"https://api.github.com/users/Siegen","html_url":"https://github.com/Siegen","followers_url":"https://api.github.com/users/Siegen/followers","following_url":"https://api.github.com/users/Siegen/following{/other_user}","gists_url":"https://api.github.com/users/Siegen/gists{/gist_id}","starred_url":"https://api.github.com/users/Siegen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siegen/subscriptions","organizations_url":"https://api.github.com/users/Siegen/orgs","repos_url":"https://api.github.com/users/Siegen/repos","events_url":"https://api.github.com/users/Siegen/events{/privacy}","received_events_url":"https://api.github.com/users/Siegen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-22T23:57:41Z","updated_at":"2016-09-23T15:49:05Z","closed_at":null,"body":"I have a few ideas for making the Commands more usable for more database structures:\r\n\r\n1. Allow the tag and image portions of the Commands and Database settings to be reversible. Either a setting to switch the order or something like tags_before fields and tags_after fields.\r\n\r\n2. Add a metadata token to Image commands for typed tags (tag categories). %allo% and %all% are untyped.\r\n\r\n3. Add the image metadata fields to the Tag commands. If nothing else, %md5% or %path% would be hugely helpful in allowing the tag commands to find the image in the database without resorting to fragile tricks like MAX(id) that can break with the bulk download.\r\n\r\nI bring these items up because it seems to be an intractable problem when trying to upload type-ed tags to shimmie. Shimmie has its tags and images in different tables (unlike gelbooru) and expects each id to exist before it will allow rows in the image_tags table (precluding tricks like MAX(id) + 1).\r\n\r\nIf you upload the tags through a tag command (the only way to get them with their type), you get stuck trying to associate them with the image, which comes after. If you try to let the image (or the After command) associate the tags with the image, you don't have the %type%s anymore. Which means you can't guarantee you won't mistake identical tags with different categories (ie. Naruto the copyright vs Naruto the character). \r\n\r\nAnd anything done in the Image or Before commands doesn't have access to the %type%s so you can only upload untyped tags (or, as above, risk ambiguities in trying to divine the type from existing tags).\r\n\r\nThe best solution I've found is to have a staging area image already in shimmie (just a junk image without any tags), use the Tag command to set all the typed tags to that known image's id, then let the Image or After command update all the tags from that junk image's id to the MAX(id) from the images table after the new image has been added.\r\n\r\nThat works okay when you're going slowly enough (and we assume there's only ever one user accessing the database) but breaks during bulk downloads. It's also pretty messy, anyways. It seems like letting all of the command fields use any of the metadata tokens shouldn't be impossible and that there should be an option for dealing with the tags after dealing with the image (that seems more logical, in my mind)."},"comment":{"url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/comments/249229231","html_url":"https://github.com/Bionus/imgbrd-grabber/issues/621#issuecomment-249229231","issue_url":"https://api.github.com/repos/Bionus/imgbrd-grabber/issues/621","id":249229231,"user":{"login":"Siegen","id":7193803,"avatar_url":"https://avatars.githubusercontent.com/u/7193803?v=3","gravatar_id":"","url":"https://api.github.com/users/Siegen","html_url":"https://github.com/Siegen","followers_url":"https://api.github.com/users/Siegen/followers","following_url":"https://api.github.com/users/Siegen/following{/other_user}","gists_url":"https://api.github.com/users/Siegen/gists{/gist_id}","starred_url":"https://api.github.com/users/Siegen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siegen/subscriptions","organizations_url":"https://api.github.com/users/Siegen/orgs","repos_url":"https://api.github.com/users/Siegen/repos","events_url":"https://api.github.com/users/Siegen/events{/privacy}","received_events_url":"https://api.github.com/users/Siegen/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T15:49:05Z","updated_at":"2016-09-23T15:49:05Z","body":"Yeah, either an option to switch the order of operations so tags are processed after images (how shimmie would prefer it) or an extra set of commands for tags that process after the image (the same loop, just after the image processing).\r\n\r\n> This has been included in the 4.7.0\r\nAh, I completely missed the namespace option, somehow. I'll take another swing at letting the Image command handle tags then.\r\n\r\n> I don't see why would someone choose Shimmie over MyImouto\r\nhttps://github.com/myimouto/myimouto/issues/204\r\nThe owner said he'd be deleting the repository (for some reason). Shimmie has been around a while and the maintainers don't seem to want to obliterate the codebase.\r\n\r\nI'll check out MyImouto but, unless the feature set is vastly better than Shimmie, I'd prefer to use a project that isn't a fork of a delete repository of a port from another language.\r\n\r\n> could you share the SQL commands you use for Shimmie\r\nSure thing. Once I get the namespace working, it should be solid. Though, I'm currently using a combination of the SQL commands and a php script to make life easier."}}
{"actor":{"display_login":"Siegen"}}