Esempio n. 1
0
	def decrement_likes_counter(self):
		shard_name = self._counter_of_likes_id
		Shard.task(shard_name, "decrement")
		
Esempio n. 2
0
	def increment_visits_counter(self):
		shard_name = self._counter_of_visits_id
		Shard.task(shard_name, "increment")
Esempio n. 3
0
	def number_of_likes(self):
		if not hasattr(self, "_number_of_likes"):
			shard_name = self._counter_of_likes_id
			self._number_of_likes = Shard.get_count(shard_name)
		return self._number_of_likes
Esempio n. 4
0
	def increment_stations_counter(self):
		shard_name = self._counter_of_stations_id
		Shard.task(shard_name, "increment")
		
Esempio n. 5
0
	def decrement_likes_counter(track_id):
		shard_name = COUNTER_OF_LIKES_PREFIX + str(track_id)
		Shard.task(shard_name, "decrement")
		
		
Esempio n. 6
0
	def number_of_likes(track_id):
		shard_name = COUNTER_OF_LIKES_PREFIX + str(track_id)
		count = Shard.get_count(shard_name)
		return count
Esempio n. 7
0
	def increase_views_counter(track_id, value):
		shard_name = COUNTER_OF_VIEWS_PREFIX + str(track_id)
		Shard.increase(shard_name, value)
Esempio n. 8
0
	def number_of_views(track_id):
		shard_name = COUNTER_OF_VIEWS_PREFIX + str(track_id)
		count = Shard.get_count(shard_name)
		return count