protected function mediaIsDirty($tags = null)
    {
        if (is_null($tags)) {
            return count($this->media_dirty_tags);
        } else {
            return count(array_intersect((array) $tags, $this->media_dirty_tags));
        }
    }