package app.furmeet.events.brasilfurfest.helper

import app.furmeet.events.brasilfurfest.schedule.managers.CacheManager
import app.furmeet.events.brasilfurfest.schedule.managers.ScheduleManager
import app.furmeet.events.brasilfurfest.schedule.managers.ScheduleManagerGetter

fun String.fromCache() =
        fromCache(ScheduleManagerGetter.get())

fun String.fromCache(cacheManager: CacheManager) =
        nullIfBlank()?.let { cacheManager[lastPathPart()]?.first }

fun String.fromCache(scheduleManager: ScheduleManager) = fromCache(scheduleManager.cacheManager)
