{"action":"created","comment":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/41707357","id":41707357,"diff_hunk":"@@ -42,26 +44,36 @@ JSONRPC_STATUS CProfilesOperations::GetProfiles(const std::string &method, ITran\n \n   HandleFileItemList(\"profileid\", false, \"profiles\", listItems, parameterObject, result);\n \n-  for (CVariant::const_iterator_array propertyiter = parameterObject[\"properties\"].begin_array(); propertyiter != parameterObject[\"properties\"].end_array(); ++propertyiter)\n+  for (CVariant::iterator_array profileIter = result[\"profiles\"].begin_array(); profileIter != result[\"profiles\"].end_array(); ++profileIter)\n   {\n-    if (propertyiter->isString() &&\n-        propertyiter->asString() == \"lockmode\")\n+    std::string profileName((*profileIter)[\"label\"].asString());\n+    int index = CProfilesManager::GetInstance().GetProfileIndex(profileName);\n+    const CProfile *profile = CProfilesManager::GetInstance().GetProfile(index);\n+\n+    for (CVariant::const_iterator_array propertyIter = parameterObject[\"properties\"].begin_array(); propertyIter != parameterObject[\"properties\"].end_array(); ++propertyIter)\n     {\n-      for (CVariant::iterator_array profileiter = result[\"profiles\"].begin_array(); profileiter != result[\"profiles\"].end_array(); ++profileiter)\n+      if (propertyIter->isString())\n       {\n-        std::string profilename = (*profileiter)[\"label\"].asString();\n-        int index = CProfilesManager::GetInstance().GetProfileIndex(profilename);\n-        const CProfile *profile = CProfilesManager::GetInstance().GetProfile(index);\n-        LockType locktype = LOCK_MODE_UNKNOWN;\n-        if (index == 0)\n-          locktype = CProfilesManager::GetInstance().GetMasterProfile().getLockMode();\n-        else\n-          locktype = profile->getLockMode();\n-        (*profileiter)[\"lockmode\"] = locktype;\n+        if (propertyIter->asString() == \"lockmode\")\n+        {\n+          LockType lockType(LOCK_MODE_UNKNOWN);\n+          if (index == 0)\n+            lockType = CProfilesManager::GetInstance().GetMasterProfile().getLockMode();\n+          else\n+            lockType = profile->getLockMode();\n+          (*profileIter)[\"lockmode\"] = lockType;\n+        }\n+        else if (propertyIter->asString() == \"directory\")\n+        {\n+          std::string path(CSpecialProtocol::TranslatePath(\"special://masterprofile\"));","path":"xbmc/interfaces/json-rpc/ProfilesOperations.cpp","position":50,"original_position":50,"commit_id":"784b9c4b35bc39d7b6f6ae456cd1e274f7f9bd35","original_commit_id":"784b9c4b35bc39d7b6f6ae456cd1e274f7f9bd35","user":{"login":"Montellese","id":75864,"avatar_url":"https://avatars.githubusercontent.com/u/75864?v=3","gravatar_id":"","url":"https://api.github.com/users/Montellese","html_url":"https://github.com/Montellese","followers_url":"https://api.github.com/users/Montellese/followers","following_url":"https://api.github.com/users/Montellese/following{/other_user}","gists_url":"https://api.github.com/users/Montellese/gists{/gist_id}","starred_url":"https://api.github.com/users/Montellese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Montellese/subscriptions","organizations_url":"https://api.github.com/users/Montellese/orgs","repos_url":"https://api.github.com/users/Montellese/repos","events_url":"https://api.github.com/users/Montellese/events{/privacy}","received_events_url":"https://api.github.com/users/Montellese/received_events","type":"User","site_admin":false},"body":"Please use `CProfilesManager::GetInstance().GetUserDataFolder()` instead of hardcoded `special://masterprofile`.","created_at":"2015-10-11T08:19:32Z","updated_at":"2015-10-11T08:19:32Z","html_url":"https://github.com/xbmc/xbmc/pull/8196#discussion_r41707357","pull_request_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8196","_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/41707357"},"html":{"href":"https://github.com/xbmc/xbmc/pull/8196#discussion_r41707357"},"pull_request":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8196"}}},"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/8196","id":47355267,"html_url":"https://github.com/xbmc/xbmc/pull/8196","diff_url":"https://github.com/xbmc/xbmc/pull/8196.diff","patch_url":"https://github.com/xbmc/xbmc/pull/8196.patch","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/8196","number":8196,"state":"open","locked":false,"title":"jsonrpc: expose profile directory in Profiles.GetCurrentProfile/GetProfiles.","user":{"login":"anaconda","id":497012,"avatar_url":"https://avatars.githubusercontent.com/u/497012?v=3","gravatar_id":"","url":"https://api.github.com/users/anaconda","html_url":"https://github.com/anaconda","followers_url":"https://api.github.com/users/anaconda/followers","following_url":"https://api.github.com/users/anaconda/following{/other_user}","gists_url":"https://api.github.com/users/anaconda/gists{/gist_id}","starred_url":"https://api.github.com/users/anaconda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anaconda/subscriptions","organizations_url":"https://api.github.com/users/anaconda/orgs","repos_url":"https://api.github.com/users/anaconda/repos","events_url":"https://api.github.com/users/anaconda/events{/privacy}","received_events_url":"https://api.github.com/users/anaconda/received_events","type":"User","site_admin":false},"body":"Bumps version to 6.31.0.\r\n\r\n```json\r\n> {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Profiles.GetProfiles\",\"params\":{\"properties\":[\"thumbnail\",\"lockmode\",\"directory\"]}}\r\n\r\n< {\"id\":1,\"jsonrpc\":\"2.0\",\"result\":{\"limits\":{\"end\":2,\"start\":0,\"total\":2},\"profiles\":[{\"directory\":\"special://masterprofile/\",\"label\":\"Master user\",\"lockmode\":0,\"thumbnail\":\"\"},{\"directory\":\"profiles/prova/\",\"label\":\"prova\",\"lockmode\":0,\"thumbnail\":\"\"}]}}\r\n```\r\n\r\n\r\n@Montellese \r\n\r\ncc @MilhouseVH @un1versal \r\n\r\nEdit: diff might be confusing - I've inverted the 2 `for` loops.","created_at":"2015-10-10T22:14:23Z","updated_at":"2015-10-11T08:19:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75fcc5094a5c215d07ea88eba43a7eb8046f6cb2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8196/commits","review_comments_url":"https://api.github.com/repos/xbmc/xbmc/pulls/8196/comments","review_comment_url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/8196/comments","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/784b9c4b35bc39d7b6f6ae456cd1e274f7f9bd35","head":{"label":"anaconda:json-profile-directory","ref":"json-profile-directory","sha":"784b9c4b35bc39d7b6f6ae456cd1e274f7f9bd35","user":{"login":"anaconda","id":497012,"avatar_url":"https://avatars.githubusercontent.com/u/497012?v=3","gravatar_id":"","url":"https://api.github.com/users/anaconda","html_url":"https://github.com/anaconda","followers_url":"https://api.github.com/users/anaconda/followers","following_url":"https://api.github.com/users/anaconda/following{/other_user}","gists_url":"https://api.github.com/users/anaconda/gists{/gist_id}","starred_url":"https://api.github.com/users/anaconda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anaconda/subscriptions","organizations_url":"https://api.github.com/users/anaconda/orgs","repos_url":"https://api.github.com/users/anaconda/repos","events_url":"https://api.github.com/users/anaconda/events{/privacy}","received_events_url":"https://api.github.com/users/anaconda/received_events","type":"User","site_admin":false},"repo":{"id":20659587,"name":"xbmc","full_name":"anaconda/xbmc","owner":{"login":"anaconda","id":497012,"avatar_url":"https://avatars.githubusercontent.com/u/497012?v=3","gravatar_id":"","url":"https://api.github.com/users/anaconda","html_url":"https://github.com/anaconda","followers_url":"https://api.github.com/users/anaconda/followers","following_url":"https://api.github.com/users/anaconda/following{/other_user}","gists_url":"https://api.github.com/users/anaconda/gists{/gist_id}","starred_url":"https://api.github.com/users/anaconda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anaconda/subscriptions","organizations_url":"https://api.github.com/users/anaconda/orgs","repos_url":"https://api.github.com/users/anaconda/repos","events_url":"https://api.github.com/users/anaconda/events{/privacy}","received_events_url":"https://api.github.com/users/anaconda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anaconda/xbmc","description":"XBMC Main Repository","fork":true,"url":"https://api.github.com/repos/anaconda/xbmc","forks_url":"https://api.github.com/repos/anaconda/xbmc/forks","keys_url":"https://api.github.com/repos/anaconda/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anaconda/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anaconda/xbmc/teams","hooks_url":"https://api.github.com/repos/anaconda/xbmc/hooks","issue_events_url":"https://api.github.com/repos/anaconda/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/anaconda/xbmc/events","assignees_url":"https://api.github.com/repos/anaconda/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/anaconda/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/anaconda/xbmc/tags","blobs_url":"https://api.github.com/repos/anaconda/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anaconda/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anaconda/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/anaconda/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anaconda/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/anaconda/xbmc/languages","stargazers_url":"https://api.github.com/repos/anaconda/xbmc/stargazers","contributors_url":"https://api.github.com/repos/anaconda/xbmc/contributors","subscribers_url":"https://api.github.com/repos/anaconda/xbmc/subscribers","subscription_url":"https://api.github.com/repos/anaconda/xbmc/subscription","commits_url":"https://api.github.com/repos/anaconda/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/anaconda/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/anaconda/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/anaconda/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/anaconda/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/anaconda/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anaconda/xbmc/merges","archive_url":"https://api.github.com/repos/anaconda/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anaconda/xbmc/downloads","issues_url":"https://api.github.com/repos/anaconda/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/anaconda/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/anaconda/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/anaconda/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anaconda/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/anaconda/xbmc/releases{/id}","created_at":"2014-06-09T19:38:10Z","updated_at":"2015-04-02T00:29:30Z","pushed_at":"2015-10-10T23:27:34Z","git_url":"git://github.com/anaconda/xbmc.git","ssh_url":"git@github.com:anaconda/xbmc.git","clone_url":"https://github.com/anaconda/xbmc.git","svn_url":"https://github.com/anaconda/xbmc","homepage":"http://xbmc.org","size":541070,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xbmc:master","ref":"master","sha":"350a8ea1497101e9bc12df8edc65c621f849fdfe","user":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"repo":{"id":1217614,"name":"xbmc","full_name":"xbmc/xbmc","owner":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xbmc/xbmc","description":"Kodi Main Repository - By using this code you agree with our policy and will follow the GPLv2 license as included","fork":false,"url":"https://api.github.com/repos/xbmc/xbmc","forks_url":"https://api.github.com/repos/xbmc/xbmc/forks","keys_url":"https://api.github.com/repos/xbmc/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbmc/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbmc/xbmc/teams","hooks_url":"https://api.github.com/repos/xbmc/xbmc/hooks","issue_events_url":"https://api.github.com/repos/xbmc/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/xbmc/xbmc/events","assignees_url":"https://api.github.com/repos/xbmc/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/xbmc/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/xbmc/xbmc/tags","blobs_url":"https://api.github.com/repos/xbmc/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbmc/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbmc/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbmc/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/xbmc/xbmc/languages","stargazers_url":"https://api.github.com/repos/xbmc/xbmc/stargazers","contributors_url":"https://api.github.com/repos/xbmc/xbmc/contributors","subscribers_url":"https://api.github.com/repos/xbmc/xbmc/subscribers","subscription_url":"https://api.github.com/repos/xbmc/xbmc/subscription","commits_url":"https://api.github.com/repos/xbmc/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbmc/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbmc/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbmc/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbmc/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/xbmc/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbmc/xbmc/merges","archive_url":"https://api.github.com/repos/xbmc/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbmc/xbmc/downloads","issues_url":"https://api.github.com/repos/xbmc/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/xbmc/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/xbmc/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/xbmc/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbmc/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/xbmc/xbmc/releases{/id}","created_at":"2011-01-03T21:18:51Z","updated_at":"2015-10-11T01:53:45Z","pushed_at":"2015-10-11T08:10:53Z","git_url":"git://github.com/xbmc/xbmc.git","ssh_url":"git@github.com:xbmc/xbmc.git","clone_url":"https://github.com/xbmc/xbmc.git","svn_url":"https://github.com/xbmc/xbmc","homepage":"http://kodi.wiki/view/Official:Trademark_Policy","size":1899564,"stargazers_count":4159,"watchers_count":4159,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3058,"mirror_url":null,"open_issues_count":184,"forks":3058,"open_issues":184,"watchers":4159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8196"},"html":{"href":"https://github.com/xbmc/xbmc/pull/8196"},"issue":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/8196"},"comments":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/8196/comments"},"review_comments":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8196/comments"},"review_comment":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/8196/commits"},"statuses":{"href":"https://api.github.com/repos/xbmc/xbmc/statuses/784b9c4b35bc39d7b6f6ae456cd1e274f7f9bd35"}}}}