zou 0.20.63__py3-none-any.whl → 0.20.65__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zou/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.20.63"
1
+ __version__ = "0.20.65"
zou/app/utils/commands.py CHANGED
@@ -741,91 +741,107 @@ def create_bot(
741
741
 
742
742
 
743
743
  def renormalize_movie_preview_files(
744
- preview_file_id=None, project_id=None, all_broken=None, all_processing=None
744
+ preview_file_id=None,
745
+ project_id=None,
746
+ all_broken=None,
747
+ all_processing=None,
748
+ days=None,
749
+ hours=None,
750
+ minutes=None,
745
751
  ):
746
752
  with app.app_context():
747
753
  if preview_file_id is None and not all_broken and not all_processing:
748
- print("You must specify at least one option.")
754
+ print(
755
+ "You must specify at least one flag from --all-broken or --all-processing."
756
+ )
749
757
  sys.exit(1)
750
- else:
751
- query = PreviewFile.query.filter(
752
- PreviewFile.extension == "mp4"
753
- ).order_by(PreviewFile.created_at.asc())
754
758
 
755
- if preview_file_id is not None:
756
- query = query.filter(PreviewFile.id == preview_file_id)
759
+ query = PreviewFile.query.filter(
760
+ PreviewFile.extension == "mp4"
761
+ ).order_by(PreviewFile.created_at.asc())
757
762
 
758
- if project_id is not None:
759
- query = query.join(Task).filter(
760
- PreviewFile.project_id == project_id
761
- )
763
+ if any((minutes, hours, days)):
764
+ since_date = datetime.datetime.now() - datetime.timedelta(
765
+ days=days or 0,
766
+ hours=hours or 0,
767
+ minutes=minutes or 0,
768
+ )
769
+ query = query.filter(PreviewFile.created_at >= since_date)
762
770
 
763
- if all_broken and all_processing:
764
- query = query.filter(
765
- PreviewFile.status.in_(("broken", "processing"))
766
- )
767
- elif all_broken:
768
- query = query.filter(PreviewFile.status == "broken")
769
- elif all_processing:
770
- query = query.filter(PreviewFile.status == "processing")
771
-
772
- preview_files = query.all()
773
- len_preview_files = len(preview_files)
774
- if len_preview_files == 0:
775
- print("No preview files found.")
776
- sys.exit(1)
777
- else:
778
- for i, preview_file in enumerate(preview_files):
771
+ if preview_file_id is not None:
772
+ query = query.filter(PreviewFile.id == preview_file_id)
773
+
774
+ if project_id is not None:
775
+ query = query.join(Task).filter(
776
+ PreviewFile.project_id == project_id
777
+ )
778
+
779
+ if all_broken and all_processing:
780
+ query = query.filter(
781
+ PreviewFile.status.in_(("broken", "processing"))
782
+ )
783
+ elif all_broken:
784
+ query = query.filter(PreviewFile.status == "broken")
785
+ elif all_processing:
786
+ query = query.filter(PreviewFile.status == "processing")
787
+
788
+ preview_files = query.all()
789
+ len_preview_files = len(preview_files)
790
+ if len_preview_files == 0:
791
+ print("No preview files found.")
792
+ sys.exit(1)
793
+ else:
794
+ for i, preview_file in enumerate(preview_files):
795
+ try:
796
+ preview_file_id = str(preview_file.id)
797
+ print(
798
+ f"Renormalizing preview file {preview_file_id} ({i+1}/{len_preview_files})."
799
+ )
800
+ extension = preview_file.extension
801
+ uploaded_movie_path = os.path.join(
802
+ config.TMP_DIR,
803
+ f"{preview_file_id}.{extension}.tmp",
804
+ )
779
805
  try:
780
- preview_file_id = str(preview_file.id)
781
- print(
782
- f"Renormalizing preview file {preview_file_id} ({i+1}/{len_preview_files})."
783
- )
784
- extension = preview_file.extension
785
- uploaded_movie_path = os.path.join(
786
- config.TMP_DIR,
787
- f"{preview_file_id}.{extension}.tmp",
788
- )
789
- try:
790
- if config.FS_BACKEND == "local":
791
- shutil.copyfile(
792
- file_store.get_local_movie_path(
793
- "source", preview_file_id
794
- ),
795
- uploaded_movie_path,
796
- )
797
- else:
798
- sync_service.download_file(
799
- uploaded_movie_path,
800
- "source",
801
- file_store.open_movie,
802
- str(preview_file_id),
803
- )
804
- except:
805
- pass
806
- if config.ENABLE_JOB_QUEUE:
807
- queue_store.job_queue.enqueue(
808
- preview_files_service.prepare_and_store_movie,
809
- args=(
810
- preview_file_id,
811
- uploaded_movie_path,
812
- True,
813
- False,
806
+ if config.FS_BACKEND == "local":
807
+ shutil.copyfile(
808
+ file_store.get_local_movie_path(
809
+ "source", preview_file_id
814
810
  ),
815
- job_timeout=int(config.JOB_QUEUE_TIMEOUT),
811
+ uploaded_movie_path,
816
812
  )
817
813
  else:
818
- preview_files_service.prepare_and_store_movie(
819
- preview_file_id,
814
+ sync_service.download_file(
820
815
  uploaded_movie_path,
821
- normalize=True,
822
- add_source_to_file_store=False,
816
+ "source",
817
+ file_store.open_movie,
818
+ str(preview_file_id),
823
819
  )
824
- except Exception as e:
825
- print(
826
- f"Renormalization of preview file {preview_file_id} failed: {e}"
820
+ except:
821
+ pass
822
+ if config.ENABLE_JOB_QUEUE:
823
+ queue_store.job_queue.enqueue(
824
+ preview_files_service.prepare_and_store_movie,
825
+ args=(
826
+ preview_file_id,
827
+ uploaded_movie_path,
828
+ True,
829
+ False,
830
+ ),
831
+ job_timeout=int(config.JOB_QUEUE_TIMEOUT),
827
832
  )
828
- continue
833
+ else:
834
+ preview_files_service.prepare_and_store_movie(
835
+ preview_file_id,
836
+ uploaded_movie_path,
837
+ normalize=True,
838
+ add_source_to_file_store=False,
839
+ )
840
+ except Exception as e:
841
+ print(
842
+ f"Renormalization of preview file {preview_file_id} failed: {e}"
843
+ )
844
+ continue
829
845
 
830
846
 
831
847
  def list_plugins(output_format, verbose, filter_field, filter_value):
zou/cli.py CHANGED
@@ -630,11 +630,17 @@ def create_bot(
630
630
  @click.option(
631
631
  "--all-processing", is_flag=True, default=False, show_default=True
632
632
  )
633
+ @click.option("--days", type=int, default=None, show_default=True)
634
+ @click.option("--hours", type=int, default=None, show_default=True)
635
+ @click.option("--minutes", type=int, default=None, show_default=True)
633
636
  def renormalize_movie_preview_files(
634
637
  preview_file_id,
635
638
  project_id,
636
639
  all_broken,
637
640
  all_processing,
641
+ days=None,
642
+ hours=None,
643
+ minutes=None,
638
644
  ):
639
645
  """
640
646
  Renormalize all preview files.
@@ -644,6 +650,9 @@ def renormalize_movie_preview_files(
644
650
  project_id,
645
651
  all_broken,
646
652
  all_processing,
653
+ days=days,
654
+ hours=hours,
655
+ minutes=minutes,
647
656
  )
648
657
 
649
658
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 0.20.63
3
+ Version: 0.20.65
4
4
  Summary: API to store and manage the data of your animation production
5
5
  Home-page: https://zou.cg-wire.com
6
6
  Author: CG Wire
@@ -70,7 +70,7 @@ Requires-Dist: semver==3.0.4
70
70
  Requires-Dist: slackclient==2.9.4
71
71
  Requires-Dist: spdx-license-list==3.27.0
72
72
  Requires-Dist: sqlalchemy_utils==0.41.2
73
- Requires-Dist: sqlalchemy==2.0.41
73
+ Requires-Dist: sqlalchemy==2.0.42
74
74
  Requires-Dist: tabulate==0.9.0
75
75
  Requires-Dist: tomlkit==0.13.3
76
76
  Requires-Dist: ua-parser==1.0.1
@@ -81,14 +81,14 @@ Requires-Dist: gevent; extra == "prod"
81
81
  Provides-Extra: dev
82
82
  Requires-Dist: wheel; extra == "dev"
83
83
  Provides-Extra: test
84
- Requires-Dist: fakeredis==2.30.2; extra == "test"
84
+ Requires-Dist: fakeredis==2.30.3; extra == "test"
85
85
  Requires-Dist: mixer==7.2.2; extra == "test"
86
86
  Requires-Dist: pytest-cov==6.2.1; extra == "test"
87
87
  Requires-Dist: pytest==8.4.1; extra == "test"
88
88
  Provides-Extra: monitoring
89
89
  Requires-Dist: prometheus-flask-exporter==0.23.2; extra == "monitoring"
90
90
  Requires-Dist: pygelf==0.4.3; extra == "monitoring"
91
- Requires-Dist: sentry-sdk==2.33.2; extra == "monitoring"
91
+ Requires-Dist: sentry-sdk==2.34.1; extra == "monitoring"
92
92
  Provides-Extra: lint
93
93
  Requires-Dist: autoflake==2.3.1; extra == "lint"
94
94
  Requires-Dist: black==25.1.0; extra == "lint"
@@ -1,5 +1,5 @@
1
- zou/__init__.py,sha256=ai0uhrOSEtfm7M8zuy6grJljhHUDgwB1NxyGnrJlc9o,24
2
- zou/cli.py,sha256=W7nhMII-gyl8AlL6zgDmverSdFphDV_WnuN3BHrHc8w,22448
1
+ zou/__init__.py,sha256=4ogylly8JzlVoVZKcXpIbcJV4b1WgVVXOm4zYLl3amg,24
2
+ zou/cli.py,sha256=N9FyrL4TDgIiCUa-I3xIzOgiVLM14kz8_QLQ48y51oE,22767
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
4
  zou/event_stream.py,sha256=9O1PE_vDW8p3yfHJNSZ8w0ybD-660x8oGN0izgJdTjM,8575
5
5
  zou/job_settings.py,sha256=_aqBhujt2Q8sXRWIbgbDf-LUdXRdBimdtTc-fZbiXoY,202
@@ -242,7 +242,7 @@ zou/app/utils/auth.py,sha256=o9lOGgj3nkfsupfhLBre5fUuT1HBZgXVJU06lrdZGag,996
242
242
  zou/app/utils/cache.py,sha256=MRluTvGG67ybOkyzgD70B6PGKMdRyFdTc0AYy3dEQe8,1210
243
243
  zou/app/utils/chats.py,sha256=ORngxQ3IQQF0QcVFJLxJ-RaU4ksQ9-0M8cmPa0pc0Ho,4302
244
244
  zou/app/utils/colors.py,sha256=LaGV17NL_8xY0XSp8snGWz5UMwGnm0KPWXyE5BTMG6w,200
245
- zou/app/utils/commands.py,sha256=_OUSRs8_qARsoTp23qAupsqhed_ryL3j3LwMpRgKECk,29995
245
+ zou/app/utils/commands.py,sha256=DghX2Z29Kg0vJFPjjYfTEnBIZpUU1Iz_ItZmrBbiD18,30115
246
246
  zou/app/utils/csv_utils.py,sha256=GiI8SeUqmIh9o1JwhZGkQXU_0K0EcPrRHYIZ8bMoYzk,1228
247
247
  zou/app/utils/date_helpers.py,sha256=jFxDPCbAasg0I1gsC72AKEbGcx5c4pLqXZkSfZ4wLdQ,4724
248
248
  zou/app/utils/dbhelpers.py,sha256=RSJuoxLexGJyME16GQCs-euFLBR0u-XAFdJ1KMSv5M8,1143
@@ -468,9 +468,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
468
468
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
469
469
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
470
470
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
471
- zou-0.20.63.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
472
- zou-0.20.63.dist-info/METADATA,sha256=ye8niDgK4xz0-E2Lw9-JVuoHd8HfTiuFdyzgdI4lOwY,6697
473
- zou-0.20.63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
474
- zou-0.20.63.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
475
- zou-0.20.63.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
476
- zou-0.20.63.dist-info/RECORD,,
471
+ zou-0.20.65.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
472
+ zou-0.20.65.dist-info/METADATA,sha256=LO-kGbIVdiovMfV7DkZJ4t3Z3-mJJ8WEBsjjXG1H4Bk,6697
473
+ zou-0.20.65.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
474
+ zou-0.20.65.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
475
+ zou-0.20.65.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
476
+ zou-0.20.65.dist-info/RECORD,,
File without changes