jebin2 commited on
Commit
af92103
·
1 Parent(s): 0d2b4eb
.github/workflows/process_csv.yml CHANGED
@@ -59,6 +59,9 @@ on:
59
  ON_SCREEN_TEXT:
60
  description: 'On Screen Text'
61
  required: false
 
 
 
62
 
63
  push:
64
  tags:
@@ -171,6 +174,7 @@ jobs:
171
  VIDEO_LIBRARY_GSHEET_WORKSHEET: ${{ github.event.inputs.VIDEO_LIBRARY_GSHEET_WORKSHEET || vars.VIDEO_LIBRARY_GSHEET_WORKSHEET }}
172
  AUDIO_LIBRARY_GSHEET_WORKSHEET: ${{ github.event.inputs.AUDIO_LIBRARY_GSHEET_WORKSHEET || vars.AUDIO_LIBRARY_GSHEET_WORKSHEET }}
173
  GSHEET_WORKSHEET_LOGS: ${{ github.event.inputs.GSHEET_WORKSHEET_LOGS || vars.GSHEET_WORKSHEET_LOGS }}
 
174
 
175
  run: |
176
  # Determine runtime inputs vs tag inputs
 
59
  ON_SCREEN_TEXT:
60
  description: 'On Screen Text'
61
  required: false
62
+ DRIVE_UPLOAD_FOLDER_ID:
63
+ description: 'Drive Upload Folder ID (Shared Drive)'
64
+ required: false
65
 
66
  push:
67
  tags:
 
174
  VIDEO_LIBRARY_GSHEET_WORKSHEET: ${{ github.event.inputs.VIDEO_LIBRARY_GSHEET_WORKSHEET || vars.VIDEO_LIBRARY_GSHEET_WORKSHEET }}
175
  AUDIO_LIBRARY_GSHEET_WORKSHEET: ${{ github.event.inputs.AUDIO_LIBRARY_GSHEET_WORKSHEET || vars.AUDIO_LIBRARY_GSHEET_WORKSHEET }}
176
  GSHEET_WORKSHEET_LOGS: ${{ github.event.inputs.GSHEET_WORKSHEET_LOGS || vars.GSHEET_WORKSHEET_LOGS }}
177
+ DRIVE_UPLOAD_FOLDER_ID: ${{ github.event.inputs.DRIVE_UPLOAD_FOLDER_ID || vars.DRIVE_UPLOAD_FOLDER_ID }}
178
 
179
  run: |
180
  # Determine runtime inputs vs tag inputs
github_workflow_app/index.html CHANGED
@@ -500,7 +500,8 @@
500
  'VIDEO_LIBRARY_GSHEET_WORKSHEET',
501
  'AUDIO_LIBRARY_GSHEET_WORKSHEET',
502
  'GSHEET_WORKSHEET_LOGS',
503
- 'GENERATION_COUNT'
 
504
  ];
505
 
506
  async function init() {
 
500
  'VIDEO_LIBRARY_GSHEET_WORKSHEET',
501
  'AUDIO_LIBRARY_GSHEET_WORKSHEET',
502
  'GSHEET_WORKSHEET_LOGS',
503
+ 'GENERATION_COUNT',
504
+ 'DRIVE_UPLOAD_FOLDER_ID'
505
  ];
506
 
507
  async function init() {
src/google_src/drive_utils.py CHANGED
@@ -191,11 +191,12 @@ def upload_file_to_drive(
191
 
192
  logger.info(f"📤 Uploading {file_path.name} to Google Drive...")
193
 
194
- # Execute upload
195
  file = service.files().create(
196
  body=file_metadata,
197
  media_body=media,
198
- fields="id, name, webViewLink, webContentLink"
 
199
  ).execute()
200
 
201
  file_id = file.get("id")
@@ -207,7 +208,8 @@ def upload_file_to_drive(
207
  body={
208
  "type": "anyone",
209
  "role": "reader"
210
- }
 
211
  ).execute()
212
  logger.info(f"✅ File shared publicly")
213
  except Exception as e:
 
191
 
192
  logger.info(f"📤 Uploading {file_path.name} to Google Drive...")
193
 
194
+ # Execute upload (supportsAllDrives=True enables Shared Drive uploads)
195
  file = service.files().create(
196
  body=file_metadata,
197
  media_body=media,
198
+ fields="id, name, webViewLink, webContentLink",
199
+ supportsAllDrives=True
200
  ).execute()
201
 
202
  file_id = file.get("id")
 
208
  body={
209
  "type": "anyone",
210
  "role": "reader"
211
+ },
212
+ supportsAllDrives=True
213
  ).execute()
214
  logger.info(f"✅ File shared publicly")
215
  except Exception as e:
src/google_src/gcs_utils.py CHANGED
@@ -90,7 +90,7 @@ def upload_file_to_gcs(
90
  account_name: str = "final_data",
91
  generate_signed_url: bool = True,
92
  fallback_to_drive: bool = True,
93
- save_in_drive_also: bool = True,
94
  ) -> dict:
95
  """
96
  Upload a local file to GCS.
 
90
  account_name: str = "final_data",
91
  generate_signed_url: bool = True,
92
  fallback_to_drive: bool = True,
93
+ save_in_drive_also: bool = True, # Uploads to Shared Drive (service account must be contributor)
94
  ) -> dict:
95
  """
96
  Upload a local file to GCS.