public Single<IssueFilter> addIssueFilter(final IssueFilter filter) {
        Repository repo = filter.getRepository();
        dbCache.getDatabase().getRepositoriesQueries().replaceRepo(
                repo.id(),
                repo.name(),
                repo.organization() != null ? repo.organization().id() : null,
                repo.owner().id(),
                repo.isPrivate(),
                repo.isFork(),
                repo.description(),
                repo.forksCount(),
                repo.watchersCount(),
                repo.language(),
                repo.hasIssues(),
                repo.mirrorUrl(),
                repo.permissions().admin(),
                repo.permissions().pull(),
                repo.permissions().push()
        );

        for (Label label : filter.getLabels()) {
            dbCache.database.getIssue_filterQueries().insertOrReplaceLabel(
                    repo.id(),
                    label.name(),
                    label.color()
            );
            dbCache.database.getIssue_filterQueries().insertOrReplaceIssueFilterLabel(
                    filter.getId(),
                    repo.id(),
                    label.name()
            );
        }

        if (filter.getMilestone() != null) {
            dbCache.database.getIssue_filterQueries().insertOrReplaceMilestone(
                    repo.id(),
                    filter.getMilestone().title(),
                    filter.getMilestone().state(),
                    filter.getMilestone().id(),
                    filter.getMilestone().number().longValue()
            );
        }

        if (filter.getAssignee() != null) {
            dbCache.database.getOrganizationsQueries().replaceUser(
                    filter.getAssignee().id(),
                    filter.getAssignee().login(),
                    filter.getAssignee().name(),
                    filter.getAssignee().avatarUrl()
            );
        }

        dbCache.database.getIssue_filterQueries().insertOrReplaceIssueFilter(
                filter.getId(),
                repo.id(),
                filter.getMilestone() != null ? filter.getMilestone().id() : null,
                filter.getAssignee() != null ? filter.getAssignee().id() : null,
                filter.isOpen(),
                filter.getDirection(),
                filter.getSortType()
        );
        return Single.just(filter);
    }
Add issue filter to store
<p/>
This method may perform file I/O and should never be called on the
UI-thread

@param filter
app/src/main/java/com/github/pockethub/android/persistence/AccountDataManager.java