the-algorithm/home-mixer/server/src/main/scala/com/twitter/home_mixer/marshaller/timelines/RecommendedUsersCursorUnmarshaller.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
2023-03-31 17:36:31 -05:00

21 lines
699 B
Scala

package com.twitter.home_mixer.marshaller.timelines
import com.twitter.product_mixer.component_library.model.cursor.UrtUnorderedExcludeIdsCursor
import com.twitter.timelines.service.{thriftscala => t}
import com.twitter.util.Time
object RecommendedUsersCursorUnmarshaller {
def apply(requestCursor: t.RequestCursor): Option[UrtUnorderedExcludeIdsCursor] = {
requestCursor match {
case t.RequestCursor.RecommendedUsersCursor(cursor) =>
Some(
UrtUnorderedExcludeIdsCursor(
initialSortIndex = cursor.minSortIndex.getOrElse(Time.now.inMilliseconds),
excludedIds = cursor.previouslyRecommendedUserIds
))
case _ => None
}
}
}