{"action":"created","issue":{"url":"https://api.github.com/repos/beetbox/beets/issues/1951","repository_url":"https://api.github.com/repos/beetbox/beets","labels_url":"https://api.github.com/repos/beetbox/beets/issues/1951/labels{/name}","comments_url":"https://api.github.com/repos/beetbox/beets/issues/1951/comments","events_url":"https://api.github.com/repos/beetbox/beets/issues/1951/events","html_url":"https://github.com/beetbox/beets/pull/1951","id":150221424,"number":1951,"title":"new template path functions: %first{} and %ifdef{}","user":{"login":"GuilhermeHideki","id":9982971,"avatar_url":"https://avatars.githubusercontent.com/u/9982971?v=3","gravatar_id":"","url":"https://api.github.com/users/GuilhermeHideki","html_url":"https://github.com/GuilhermeHideki","followers_url":"https://api.github.com/users/GuilhermeHideki/followers","following_url":"https://api.github.com/users/GuilhermeHideki/following{/other_user}","gists_url":"https://api.github.com/users/GuilhermeHideki/gists{/gist_id}","starred_url":"https://api.github.com/users/GuilhermeHideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuilhermeHideki/subscriptions","organizations_url":"https://api.github.com/users/GuilhermeHideki/orgs","repos_url":"https://api.github.com/users/GuilhermeHideki/repos","events_url":"https://api.github.com/users/GuilhermeHideki/events{/privacy}","received_events_url":"https://api.github.com/users/GuilhermeHideki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T23:47:18Z","updated_at":"2016-04-22T19:53:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/beetbox/beets/pulls/1951","html_url":"https://github.com/beetbox/beets/pull/1951","diff_url":"https://github.com/beetbox/beets/pull/1951.diff","patch_url":"https://github.com/beetbox/beets/pull/1951.patch"},"body":"The `%first{}` function is inspired by the MediaMonkey `$First(Field, count, skip)`. By default, returns the first element, separated by `; `.\r\n\r\nThe `%ifdef{field, trueval, falseval}` , for now, returns the field from the item, but wouldn't work with albums. How to resolve this?\r\n1, Have 2 commands, like `%ifdef_item{}/%ifdef_album{}`\r\n2. try to get the album's field, and if can't get, return the item's field or vice-versa (may be a problem with duplicated fields)?"},"comment":{"url":"https://api.github.com/repos/beetbox/beets/issues/comments/213567774","html_url":"https://github.com/beetbox/beets/pull/1951#issuecomment-213567774","issue_url":"https://api.github.com/repos/beetbox/beets/issues/1951","id":213567774,"user":{"login":"GuilhermeHideki","id":9982971,"avatar_url":"https://avatars.githubusercontent.com/u/9982971?v=3","gravatar_id":"","url":"https://api.github.com/users/GuilhermeHideki","html_url":"https://github.com/GuilhermeHideki","followers_url":"https://api.github.com/users/GuilhermeHideki/followers","following_url":"https://api.github.com/users/GuilhermeHideki/following{/other_user}","gists_url":"https://api.github.com/users/GuilhermeHideki/gists{/gist_id}","starred_url":"https://api.github.com/users/GuilhermeHideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuilhermeHideki/subscriptions","organizations_url":"https://api.github.com/users/GuilhermeHideki/orgs","repos_url":"https://api.github.com/users/GuilhermeHideki/repos","events_url":"https://api.github.com/users/GuilhermeHideki/events{/privacy}","received_events_url":"https://api.github.com/users/GuilhermeHideki/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T19:53:37Z","updated_at":"2016-04-22T19:53:37Z","body":"- The first point, I don't know how uncommon is something like \"The first three athletes…\", for example, but is more natural, IMHO `%first{athletes,3}` vs. `%cut{athletes,3}`. Maybe `%list{athletes,3}`\r\n- Used the `self.item.formatted()` now"}}