Skip to content

Commit

Permalink
Temporarily remove track repost and save prevention for premium track…
Browse files Browse the repository at this point in the history
…s in indexing (#3792)

Co-authored-by: Saliou Diallo <saliou@audius.co>
  • Loading branch information
sddioulde and Saliou Diallo authored Aug 30, 2022
1 parent 843c8c9 commit 287f5e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
35 changes: 0 additions & 35 deletions discovery-provider/src/tasks/social_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
from src.models.playlists.playlist import Playlist
from src.models.social.follow import Follow
from src.models.social.repost import Repost, RepostType
from src.premium_content.premium_content_access_checker import (
premium_content_access_checker,
)
from src.utils.indexing_errors import IndexingError

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -208,27 +205,11 @@ def add_track_repost(
)
)

premium_content_access_args = []
for event in new_track_repost_events:
premium_content_access_args.append(
{
"user_id": event["args"]._userId,
"premium_content_id": event["args"]._trackId,
"premium_content_type": "track",
}
)
premium_content_access = premium_content_access_checker.check_access_for_batch(
premium_content_access_args
)

for event in new_track_repost_events:
event_args = event["args"]
repost_user_id = event_args._userId
repost_track_id = event_args._trackId

if not premium_content_access["track"][repost_user_id][repost_track_id]:
continue

if (repost_user_id in track_repost_state_changes) and (
repost_track_id in track_repost_state_changes[repost_user_id]
):
Expand Down Expand Up @@ -270,27 +251,11 @@ def delete_track_repost(
)
)

premium_content_access_args = []
for event in new_repost_events:
premium_content_access_args.append(
{
"user_id": event["args"]._userId,
"premium_content_id": event["args"]._trackId,
"premium_content_type": "track",
}
)
premium_content_access = premium_content_access_checker.check_access_for_batch(
premium_content_access_args
)

for event in new_repost_events:
event_args = event["args"]
repost_user_id = event_args._userId
repost_track_id = event_args._trackId

if not premium_content_access["track"][repost_user_id][repost_track_id]:
continue

if (repost_user_id in track_repost_state_changes) and (
repost_track_id in track_repost_state_changes[repost_user_id]
):
Expand Down
35 changes: 0 additions & 35 deletions discovery-provider/src/tasks/user_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from src.database_task import DatabaseTask
from src.models.playlists.playlist import Playlist
from src.models.social.save import Save, SaveType
from src.premium_content.premium_content_access_checker import (
premium_content_access_checker,
)
from src.utils.indexing_errors import IndexingError

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -153,27 +150,11 @@ def add_track_save(
)
)

premium_content_access_args = []
for event in new_add_track_events:
premium_content_access_args.append(
{
"user_id": event["args"]._userId,
"premium_content_id": event["args"]._trackId,
"premium_content_type": "track",
}
)
premium_content_access = premium_content_access_checker.check_access_for_batch(
premium_content_access_args
)

for event in new_add_track_events:
event_args = event["args"]
save_user_id = event_args._userId
save_track_id = event_args._trackId

if not premium_content_access["track"][save_user_id][save_track_id]:
continue

if (save_user_id in track_state_changes) and (
save_track_id in track_state_changes[save_user_id]
):
Expand Down Expand Up @@ -270,27 +251,11 @@ def delete_track_save(
)
)

premium_content_access_args = []
for event in new_delete_track_events:
premium_content_access_args.append(
{
"user_id": event["args"]._userId,
"premium_content_id": event["args"]._trackId,
"premium_content_type": "track",
}
)
premium_content_access = premium_content_access_checker.check_access_for_batch(
premium_content_access_args
)

for event in new_delete_track_events:
event_args = event["args"]
save_user_id = event_args._userId
save_track_id = event_args._trackId

if not premium_content_access["track"][save_user_id][save_track_id]:
continue

if (save_user_id in track_state_changes) and (
save_track_id in track_state_changes[save_user_id]
):
Expand Down

0 comments on commit 287f5e2

Please sign in to comment.