package app.furmeet.events.system.helper

import app.furmeet.events.system.schedule.managers.CacheManager
import app.furmeet.events.system.schedule.managers.ScheduleManager
import app.furmeet.events.system.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)
