{"size": 1593, "ext": "js", "max_stars_repo_path": "firebase/scripts.js", "max_stars_repo_name": "tiwadara/InternalAppStore", "max_stars_repo_stars_event_min_datetime": "2018-05-15T09:44:37.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-26T22:47:41.000Z", "max_issues_repo_path": "firebase/scripts.js", "max_issues_repo_name": "mohsinalimat/InternalAppStore", "max_issues_repo_issues_event_min_datetime": "2018-05-14T17:07:48.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-17T08:45:38.000Z", "max_forks_repo_path": "firebase/scripts.js", "max_forks_repo_name": "mohsinalimat/InternalAppStore", "max_forks_repo_forks_event_min_datetime": "2018-07-04T00:46:35.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-11T01:54:41.000Z"}
{"max_stars_count": 427, "max_issues_count": 12, "max_forks_count": 50, "avg_line_length": 41.9210526316, "max_line_length": 103, "alphanum_fraction": 0.458254865}
/* List of useful scripts */

function refresh_apk_properties() {
    window.store.databaseRefs.store.once("value").then(snapshot => {
        const store = snapshot.val();
        if (!store || !store.applications || !store.versions) {
            return;
        }
        for (const [applicationKey, application] of Object.entries(store.applications)) {
            for (const [versionKey, version] of Object.entries(store.versions[applicationKey] || {})) {
                const versionRef = window.store.databaseRefs.version(applicationKey, versionKey);
                if (version.apkRef) {
                    window.store.storageRefs.of(version.apkRef).getMetadata().then(function(metadata) {
                        versionRef.update({
                            apkUrl: null,
                            apkSize: metadata.size
                        }).then(function(success) {
                            console.log(application.name, version.name, "Updated to", metadata.size);
                        }).catch(function(error) {
                            console.error(error);
                        });
                    }).catch(function(error) {
                        console.error(error);
                    });
                } else {
                    versionRef.update({
                        apkRef: null,
                        apkSize: null,
                        apkGeneration: null
                    }).catch(function(error) {
                        console.error(error);
                    });
                }
            }
        }
    });
}
