<commit_before>angular.module('frontpress.views.post').controller('PostDirectiveController', PostDirectiveController);

function PostDirectiveController(FullPostModel, $stateParams, PageHeadModel, SlugsMapModel, $Frontpress){
	var vc = this;
    vc.vm = FullPostModel;
    var postSlug = $stateParams.postSlug;
    var cachedSlugs = SlugsMapModel.getCachedSlugs();	

    var idProperty;
    switch($Frontpress.apiVersion){
        case "v2":
            idProperty = "id";
        break;
        case "v1":
            idProperty = "ID";
        break;              
    }           
    
    var postId = JSON.search(cachedSlugs, '//*[slug="{0}"]/{1}'.format(postSlug, idProperty))[0]; 

    var fullPostPromise = FullPostModel.loadFullPostById(postId);
    var postTagsPromise = FullPostModel.loadFullPostTagsById(postId);
    var postCategoriesPromise = FullPostModel.loadFullPostCategoriesById(postId);
    PageHeadModel.init();

    fullPostPromise.then(function(result){
        PageHeadModel.setPageTitle(FullPostModel.title);
        vc.disqusId = FullPostModel.slug;
	});

}<commit_msg>[#46] Corrigindo titulo do post para v2<commit_after>angular.module('frontpress.views.post').controller('PostDirectiveController', PostDirectiveController);

function PostDirectiveController(FullPostModel, $stateParams, PageHeadModel, SlugsMapModel, $Frontpress){
	var vc = this;
    vc.vm = FullPostModel;
    var postSlug = $stateParams.postSlug;
    var cachedSlugs = SlugsMapModel.getCachedSlugs();	

    var idProperty;
    switch($Frontpress.apiVersion){
        case "v2":
            idProperty = "id";
        break;
        case "v1":
            idProperty = "ID";
        break;              
    }           
    
    var postId = JSON.search(cachedSlugs, '//*[slug="{0}"]/{1}'.format(postSlug, idProperty))[0]; 

    var fullPostPromise = FullPostModel.loadFullPostById(postId);
    var postTagsPromise = FullPostModel.loadFullPostTagsById(postId);
    var postCategoriesPromise = FullPostModel.loadFullPostCategoriesById(postId);
    PageHeadModel.init();

    fullPostPromise.then(function(result){
        var postTitle;
        switch($Frontpress.apiVersion){
            case "v2":
                postTitle = FullPostModel.title.rendered;
            break;
            case "v1":
                postTitle = FullPostModel.title;
            break;              
        }                      
        PageHeadModel.setPageTitle(postTitle);
        vc.disqusId = FullPostModel.slug;
	});

}
{'fraction_non_alphanumeric': 0.11093375897845172, 'fraction_numerical': 0.005985634477254589, 'mean_word_length': 2.8216463414634148, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7389322', 'n_tokens_mistral': 755, 'n_tokens_neox': 735, 'n_words': 121}