Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cp_video_dokku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Dzehil
cp_video_dokku
Commits
f0b05146
Commit
f0b05146
authored
2 years ago
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete old tasks for send videos to s3
parent
a830a3cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
55 deletions
+0
-55
tasks.py
apps/core/tasks.py
+0
-55
No files found.
apps/core/tasks.py
View file @
f0b05146
...
...
@@ -20,61 +20,6 @@ playlist_content_type = ContentType.objects.get_for_model(Playlist)
log
=
logging
.
getLogger
(
'send_video_to_s3'
)
# @app.task(soft_time_limit=60)
# def send_video_to_s3():
# local_videos = Video.objects.filter(
# local_file__isnull=False
# ).prefetch_related('tags', 'categories')
#
# for local_video in local_videos:
# log.info(f'Uploading video {local_video.id} to S3...')
# video_name = local_video.local_file.name.split('/')[-1]
# key = asset_upload(local_video, video_name)
# file_path = settings.DOMAIN_NAME + settings.MEDIA_URL + key
# log.info(f'File path: {file_path}')
#
# response = requests.get(file_path)
# content = response.content
#
# local_video.s3_file = upload_file(content, key, 'video/mp4')
# local_video.status = READY
#
# # if not local_video.thumbnail and local_video.local_file:
# # log.info(f'Uploading thumbnail for video {local_video.id} to S3...')
# # thumbnail_name = generate_thumbnail(file_path, video_name)
# # key = f'videos/{thumbnail_name}'
# # thumbnail_path = settings.DOMAIN_NAME + settings.MEDIA_URL + thumbnail_name
# # response = requests.get(thumbnail_path)
# # content = response.content
# # content_type = 'image/jpeg'
# # local_video.thumbnail = upload_file(content, key, content_type)
# # log.info(f'Thumbnail for video {local_video.id} uploaded to S3...')
#
# local_video.save(update_fields=['s3_file', 'status', 'thumbnail'])
#
# tag_ids = list(TagToObject.objects.filter(
# content_type=video_content_type,
# object_id=local_video.id,
# ).values_list('tag_id', flat=True))
#
# if tag_ids:
# playlist_ids = list(TagToObject.objects.filter(
# content_type=playlist_content_type,
# tag_id__in=tag_ids,
# ).values_list('object_id', flat=True))
#
# if playlist_ids:
# playlists = Playlist.objects.filter(
# id__in=playlist_ids,
# type=DYNAMIC,
# )
#
# for playlist in playlists:
# playlist.videos.add(local_video)
#
# local_videos.update(local_file=None)
@
app
.
task
(
soft_time_limit
=
600
)
def
send_video_to_s3
(
video_id
=
None
):
local_video
=
Video
.
objects
.
get
(
id
=
video_id
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment