fli_video 0.0.2 → 0.1.0

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.builders/klues/add_episode.klue +25 -0
  3. data/.builders/klues/change_chapter_name.klue +32 -0
  4. data/.builders/klues/create_chapter_video.klue +34 -0
  5. data/.builders/klues/create_project.klue +37 -0
  6. data/.builders/klues/empty_trash.klue +24 -0
  7. data/.builders/klues/episode_path.klue +77 -0
  8. data/.builders/klues/global_config.klue +31 -0
  9. data/.builders/klues/move_ecamm_file.klue +21 -0
  10. data/.builders/klues/move_to_trash.klue +29 -0
  11. data/.builders/klues/open_in_finder.klue +25 -0
  12. data/.builders/klues/project_config.klue +123 -0
  13. data/.builders/klues/project_meta_data_store.klue +28 -0
  14. data/.builders/klues/project_path.klue +77 -0
  15. data/.builders/klues/recording_file_watcher.klue +28 -0
  16. data/.builders/klues/recording_filename.klue +112 -0
  17. data/.builders/klues/restore_from_trash.klue +29 -0
  18. data/.builders/klues/switch_focus.klue +24 -0
  19. data/.builders/klues/text_to_speech.klue +29 -0
  20. data/.builders/klues/transcript_data_store.klue +28 -0
  21. data/.rubocop.yml +2 -0
  22. data/CHANGELOG.md +18 -0
  23. data/README.md +13 -20
  24. data/bin/fli_video +6 -0
  25. data/docs/feature-list.md +75 -0
  26. data/docs/generated/application-structure.json +57 -0
  27. data/docs/generated/features-and-components.md +987 -0
  28. data/docs/generated/technical-design-and-features.md +420 -0
  29. data/docs/technical-specifications.md +347 -0
  30. data/fli.rb +138 -0
  31. data/lib/fli_video/cli.rb +30 -0
  32. data/lib/fli_video/version.rb +1 -1
  33. data/package-lock.json +2 -2
  34. data/package.json +1 -1
  35. data/scripts/01-get-structure.rb +84 -0
  36. data/scripts/02-get-features-and-components.rb +38 -0
  37. data/scripts/03-get-technical-design-and-features.rb +27 -0
  38. metadata +32 -3
  39. data/README-features.md +0 -36
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bfc30a6f56a497cc47ce80f0e2c09090b83abedf8586aedac879208512577a4
4
- data.tar.gz: 011af4a5c4fda0c15209e0b9fc2b799b91d05dde3ebd5450b70c0e364b724e0d
3
+ metadata.gz: 3f8eeca7da2f46b1cd391df1040ded562b42a9125bb73966f404b1e221f7f6e7
4
+ data.tar.gz: e99e385feffbdb307d076a344e36b630807b40ec3b8ee1017a784e0866c8d5d3
5
5
  SHA512:
6
- metadata.gz: 9cba026b1099cdbf9c8b1be009c22570f5160a608b098e1dd7539332d347dd47034cf25d942c951fcfe8d126ec1a26034ccbb3ac57d3bac089bdd2e6a02d95d2
7
- data.tar.gz: 6b82f13326684e05659ccfc244e5c4a49a8af7f75b695cca1378cf33891f378c94870d0fe4faedbe6f38a1d9debcf1cf535d7e84413cd87447b81e794d686227
6
+ metadata.gz: aab6ec36d5b3cbe6bdb5c5fa598fa060af9ae618f2b9dc2d1fb07ad7dd06cce9b04c3fe3122f86c7a5a90fbe0013e5a3f27d4d6c7272684438c951fb738c8c9b
7
+ data.tar.gz: 0521d407ee628afd67a31f58f72ad8b69cfed61ce8f43a57d8d53bddd4dd2344e6ff5cc5be355dea172e27edd702ea2f8a3cdf4ca91bcb633a751ef87ca2f53a
@@ -0,0 +1,25 @@
1
+ component :add_episode do
2
+ desc "Add a new episode to an existing podcast project."
3
+
4
+ pattern "Interactor"
5
+
6
+ comments <<~TEXT
7
+ - Facilitates the addition of a new episode to a specific podcast project.
8
+ - Requires the project code of the podcast to ensure correct association.
9
+ - Allows setting of episode-specific details like episode code and name.
10
+ - Ensures that the episode is added only to podcast projects and not to other project types.
11
+ - Will create recording, chapter and support folders for the episode.
12
+ TEXT
13
+
14
+ method :run(:project_code, :episode_code, :episode_name)
15
+
16
+ sample :add_episode_to_podcast, <<~RUBY
17
+ # Add a new episode to existing podcast folder
18
+ add_episode.run('a21', '01', 'Episode About Something')
19
+ # Create:
20
+ # ~/video-projects/a21-ac-some-podcast/01-episode-about-something/assets
21
+ # ~/video-projects/a21-ac-some-podcast/01-episode-about-something/chapters
22
+ # ~/video-projects/a21-ac-some-podcast/01-episode-about-something/recordings
23
+ # ~/video-projects/a21-ac-some-podcast/01-episode-about-something/.trash
24
+ RUBY
25
+ end
@@ -0,0 +1,32 @@
1
+ component :change_chapter_name do
2
+ desc "Alter the name of a chapter based on its sequence in the project, facilitating better organization and identification of video content."
3
+
4
+ pattern "Command"
5
+ note "This should be a method on the project"
6
+
7
+ comments <<~TEXT
8
+ - Allows the renaming of a chapter within a video project.
9
+ - Utilizes the chapter's sequence number to identify and target the specific chapter for renaming.
10
+ TEXT
11
+
12
+ method :rename_chapter(:parent, :chapter_sequence, :new_name)
13
+
14
+ <<~FILE_SYSTEM
15
+ 01-a-introduction-GPTIMPROVE.mov
16
+ 01-b-introduction-more-content.mov
17
+ 01-c-introduction.mov
18
+ 01-d-introduction-CTA.mov
19
+ 02-a-overview.mov
20
+ 03-a-scenario-TITLE.mov
21
+ FILE_SYSTEM
22
+
23
+ sample :change_chapter_name_in_project, <<~RUBY
24
+ # Example of changing the name of a specific chapter in a project
25
+ change_chapter_name.rename_chapter('a27', '01', 'intro')
26
+
27
+ # 01-a-intro-GPTIMPROVE.mov
28
+ # 01-b-intro.mov
29
+ # 01-c-intro.mov
30
+ # 01-d-intro-CTA.mov
31
+ RUBY
32
+ end
@@ -0,0 +1,34 @@
1
+ component :create_chapter_video do
2
+ desc "Combine and all video parts for a chapter sequence and put into the chapters folder."
3
+
4
+ pattern "Command"
5
+
6
+ comments <<~TEXT
7
+ - Combines individual video segments into a single chapter video.
8
+ - Facilitates independent review and editing of each chapter.
9
+ TEXT
10
+
11
+ constructor(:parent_project)
12
+
13
+ method :run(:chapter_seq)
14
+
15
+ sample :create_chapter_video, <<~RUBY
16
+ project_path = ProjectPath.new('a27')
17
+
18
+ # Instantiate the component with the parent project
19
+ create_chapter_video = generate_chapter_video.new(project_path)
20
+
21
+ # Automatically combine all video segments for a chapter
22
+ create_chapter_video.run(1)
23
+ # Output: '~/video-projects/a27-ac-some-podcast/chapters/01-complete-chapter.mov'
24
+ RUBY
25
+
26
+ sample :create_chapter_video_for_segments, <<~RUBY
27
+ project_path = ProjectPath.new('a27')
28
+
29
+ create_chapter_video = generate_chapter_video.new(project_path)
30
+
31
+ create_chapter_video.run(1, ['01-intro-a.mov', '02-intro-b.mov'], output_file_name: '01-intro-custom.mov')
32
+ # Output: '~/video-projects/a27-ac-some-podcast/chapters/01-intro-custom.mov'
33
+ RUBY
34
+ end
@@ -0,0 +1,37 @@
1
+ component :create_project do
2
+ desc "Setup a new video project for standalone YouTube video or Podcast."
3
+
4
+ pattern "Interactor"
5
+
6
+ comments <<~TEXT
7
+ - Allows the creation of a new project, specifying if it's for a YouTube video or a Podcast.
8
+ - For YouTube videos, the project will be single-episode based.
9
+ - For Podcasts, the project can include multiple episodes.
10
+ - Stores project-specific settings and metadata.
11
+ - Will create recording, chapter and support folders for project_type: video
12
+ TEXT
13
+
14
+ enum :project_type, %w(video podcast)
15
+
16
+ method :run(:project_type, :project_code, :channel_code, :project_name)
17
+
18
+ sample :new_video_project, <<~RUBY
19
+ # Create a new video project for AppyDave
20
+ create_project.run(:video, 'a20', 'ad', 'Some Video')
21
+ # Create:
22
+ # ~/video-projects/a20-ad-some-video
23
+ # ~/video-projects/a20-ad-some-video/.fv.json
24
+ # ~/video-projects/a20-ad-some-video/assets
25
+ # ~/video-projects/a20-ad-some-video/chapters
26
+ # ~/video-projects/a20-ad-some-video/recordings
27
+ # ~/video-projects/a20-ad-some-video/.trash
28
+ RUBY
29
+
30
+ sample :new_podcast_project, <<~RUBY
31
+ # Create a new podcast project for AppyCast
32
+ create_project.run(:podcast, 'a21', 'ac', 'Some Podcast')
33
+ # Creates folder:
34
+ # ~/video-projects/a21-ac-some-podcast
35
+ # ~/video-projects/a21-ac-some-podcast/.fv.json
36
+ RUBY
37
+ end
@@ -0,0 +1,24 @@
1
+ component :empty_trash do
2
+ desc "Permanently delete video takes from the '.trash' folder."
3
+
4
+ pattern "Command"
5
+
6
+ comments <<~TEXT
7
+ - Permanently removes all recordings from the trash folder.
8
+ - Frees up storage space by deleting unnecessary files.
9
+ - Maintains project clarity by clearing clutter.
10
+ - Ensures that only unwanted takes are deleted after a final review.
11
+ TEXT
12
+
13
+ constructor(:parent_project)
14
+
15
+ method :run
16
+
17
+ sample :permanently_delete_trash, <<~RUBY
18
+ project_path = ProjectPath.new('a27')
19
+
20
+ # Permanently deleting all contents of the trash folder
21
+ clean_trash.empty_trash
22
+ # Empties the entire .trash folder in "~/video-projects/a27-ac-categorize-mp4-CI/.trash/
23
+ RUBY
24
+ end
@@ -0,0 +1,77 @@
1
+ component :episode_path do
2
+ desc "Construct episode path using project/episode code and deducing state based on existing folder name."
3
+
4
+ pattern "Adapter"
5
+
6
+ comments <<~TEXT
7
+ - Infers episode path based on episode code and existing folder name.
8
+ - Maintains state for episode code and descriptive name and keywords.
9
+ - Will use current project code if not provided.
10
+ - Path is relative to project path.
11
+ - Uses existing folder name and keywords to build internal state.
12
+ - Provides method for building absolute, relative and sub folder.
13
+ - Provides method for building a new path for rename operations.
14
+ - Provides access to associated project.
15
+ - Stores state in an internal data object.
16
+ - Designed for building folder names, not create or modify actual directories.
17
+ TEXT
18
+
19
+ accessors :episode_code, :episode_name, :keywords, :episode_path, :project
20
+
21
+ method :constructor(:episode_code, episode_name: nil, keywords: nil, project_code: nil)
22
+ method :instance(:folder)
23
+
24
+ method :change_path(episode_code: nil, episode_name: nil, keywords: nil)
25
+
26
+ # project_path.recording_path # => "~/video-projects/a27-ac-categorize-mp4-CI/recordings"
27
+ # ~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO/recordings
28
+
29
+ sample :create_episode_path, <<~RUBY
30
+ # Create a new episode path
31
+ episode_path = EpisodePath.new('01', episode_name: 'flivideo-project-kickoff', keywords: ['TODO'] )
32
+ episode_path.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO"
33
+ episode_path.episode_code # => "01"
34
+ episode_path.episode_name # => "flivideo-project-kickoff"
35
+ episode_path.keywords # => ["TODO"]
36
+
37
+ project_path = episode_path.project
38
+ project_path.project_path # => "~/video-projects/a27-ac-categorize-mp4-CI"
39
+ RUBY
40
+
41
+ sample :infer_episode_path, <<~RUBY
42
+ # Infer episode path based on episode code and existing folder
43
+ episode_path = EpisodePath.new('01')
44
+ episode_path.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO"
45
+ episode_path.episode_code # => "01"
46
+ episode_path.episode_name # => "flivideo-project-kickoff"
47
+ episode_path.keywords # => ["TODO"]
48
+
49
+ RUBY
50
+
51
+ sample :rename_episode_path, <<~RUBY
52
+ # Rename episode path
53
+ episode1 = EpisodePath.new('01')
54
+ episode1.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO"
55
+
56
+ episode2 = episode1.change_path(episode_code: '02')
57
+ episode2.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/02-flivideo-project-kickoff-TODO"
58
+
59
+ episode3 = episode1.change_path(episode_code: '03', episode_name: 'build-gpts', keywords: [])
60
+ episode3.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/03-build-gpts"
61
+ RUBY
62
+
63
+ sample :next_episode_code, <<~RUBY
64
+ # Get next episode code
65
+ episode_path = EpisodePath.new('01')
66
+ episode_path.next_episode_code # => "02"
67
+ RUBY
68
+
69
+ sample :folder_to_episode_path, <<~RUBY
70
+ # Convert folder to episode path
71
+ episode_path = EpisodePath.instance('~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO')
72
+ episode_path.episode_path # => "~/video-projects/a27-ac-categorize-mp4-CI/01-flivideo-project-kickoff-TODO"
73
+ episode_path.episode_code # => "01"
74
+ episode_path.episode_name # => "flivideo-project-kickoff"
75
+ episode_path.keywords # => ["TODO"]
76
+ RUBY
77
+ end
@@ -0,0 +1,31 @@
1
+ component :global_configuation do
2
+ pattern "Singleton"
3
+
4
+ desc "Access and apply global configuration settings for video asset management and state consistency."
5
+
6
+ comments <<~TEXT
7
+ Configuration file path: ~/.fli-video.json
8
+ - Automatically creates a configuration file if it does not exist.
9
+ - Responsible for reading and updating global configuration.
10
+ - Provides methods to manage folder paths and various settings.
11
+ TEXT
12
+
13
+ sample :configuration, <<~JSON
14
+ {
15
+ "folders": {
16
+ "ecamm-recordings": "~/Movies/Ecamm Live Recordings",
17
+ "project-root": "/Volumes/Expansion/Sync/tube-channels/a-cast/cast-active",
18
+ },
19
+ "settings": {
20
+ "focus-project-code": "a27",
21
+ },
22
+ }
23
+ JSON
24
+
25
+ method :set_folder(:key, :folder)
26
+ method :folder(:key)
27
+ method :set_setting(:key, :value)
28
+ method :setting(:key)
29
+ method :load
30
+ method :save
31
+ end
@@ -0,0 +1,21 @@
1
+ component :move_ecamm_file do
2
+ desc "Seamlessly transfer eCamm recordings to the current focused video or podcast episode recordings subfolder."
3
+
4
+ comments <<~TEXT
5
+ - Facilitates the transfer of eCamm recording files to the appropriate project's recording subfolder.
6
+ - Automatically identifies the current focused project or episode to ensure correct file placement.
7
+ - Handles the file transfer process, maintaining file integrity and updating any necessary metadata.
8
+ - Uses global configuration to determine eCamm recording folder location.
9
+ - Uses current project configuration to determine recording subfolder location.
10
+ - Aborts the transfer process if target folder does not exist.
11
+ TEXT
12
+
13
+ method :execute(:ecamm_file_name)
14
+
15
+ sample :move_ecamm_file_to_project, <<~RUBY
16
+ # Move an eCamm recording to the currently focused project's recordings subfolder
17
+ move_ecamm_file.execute('Ecamm Live Recording on 2023-08-25 at 14.51.58.mov')
18
+
19
+ # ~/video-projects/a20-ad-some-video/recordings/Ecamm Live Recording on 2023-08-25 at 14.51.58.mov
20
+ RUBY
21
+ end
@@ -0,0 +1,29 @@
1
+ component :move_to_trash do
2
+ desc "Move suboptimal video takes to '.trash' folder"
3
+
4
+ pattern "Command"
5
+
6
+ comments <<~TEXT
7
+ - Will trash a specific recording in a project folder.
8
+ - Will identify the last eCamm recording in a project folder if no specific recording is provided.
9
+ - Enhances project clarity and organization.
10
+ TEXT
11
+
12
+ constructure(:parent_project)
13
+
14
+ method :run(:file_name)
15
+
16
+ sample :move_video_to_trash, <<~RUBY
17
+ project_path = ProjectPath.new('a27')
18
+
19
+ command = move_to_trash.new(project_path)
20
+
21
+ # Example of moving a specific suboptimal video take to the trash folder
22
+ command.run('01-a-introduction.mov')
23
+ # => "~/video-projects/a27-ac-categorize-mp4-CI/.trash/01-a-introduction.mov"
24
+
25
+ # Example of moving the last suboptimal video take to the trash folder
26
+ command.run
27
+ # => "~/video-projects/a27-ac-categorize-mp4-CI/.trash/Ecamm Live Recording on 2023-08-25 at 14.51.58.mov
28
+ RUBY
29
+ end
@@ -0,0 +1,25 @@
1
+ component :open_in_finder do
2
+ desc "Quickly access video project and episode folders within the Finder."
3
+
4
+ pattern "Command"
5
+
6
+ comments <<~TEXT
7
+ - Provides shortcuts to open project and episode folders in the Finder.
8
+ - Enhances efficiency in navigating to specific video project locations.
9
+ - Streamlines the process of locating and managing video files and folders.
10
+ TEXT
11
+
12
+ constructor(:parent_project)
13
+
14
+ method :run
15
+
16
+ sample :access_project_in_finder, <<~RUBY
17
+ project_path = ProjectPath.new('a27')
18
+
19
+ command = open_in_finder.new(project_path)
20
+ # Opens the folder for project 'a27' in Finder
21
+
22
+ command.run
23
+ # Opens the folder for episode '01' of project 'a27' in Finder
24
+ RUBY
25
+ end
@@ -0,0 +1,123 @@
1
+ component :project_configuration do
2
+ desc "Manage project / episode settings and state."
3
+
4
+ pattern "Adapter"
5
+
6
+ comments <<~TEXT
7
+ Configuration file: .fv.json
8
+ - Handles settings for single videos or the episodes in a Podcast.
9
+ - Responsible for reading and updating settings.
10
+ - Supports state management for single video, episodes, recording and chapter progression.
11
+ - This class is a reflection of the configuration file and the folders and files it manages.
12
+
13
+ Project type: video
14
+ - A single video file.
15
+ - Supports recording and chapter progression
16
+
17
+ Project type: podcast
18
+ - Multiple video files known as episodes.
19
+ - Supports recording and chapter progression for each episode.
20
+
21
+ Infers project type from the presence of the "episodes" key.
22
+ Infers project name from the name of the folder containing the configuration file.
23
+ Infers episode name from the name of the folder containing the video file.
24
+ Keeps track of prefered chapter name for each chapter sequence.
25
+ TEXT
26
+
27
+ method :load
28
+ method :save
29
+ method :resync_project_files() # refreshes the configuration based on the file system
30
+ method :current_chapter() # if type == :video
31
+ method :current_episode() # if type == :podcast
32
+
33
+ data_object :project_config do
34
+ constructor(:json)
35
+
36
+ attribute :type # video, podcast
37
+ attribute :code
38
+ attribute :chapters # if type == :video
39
+ attribute :episodes # if type == :podcast
40
+ end
41
+
42
+ data_object :episode_config do
43
+ constructor(:json)
44
+
45
+ attribute :seq # episode number store as number, but displayed as 2 digit string
46
+ attribute :chapters
47
+ attribute :current # true if this is the current episode
48
+
49
+ method :current_chapter()
50
+ end
51
+
52
+ data_object :chapter_config do
53
+ constructor(:json)
54
+
55
+ attribute :seq
56
+ attribute :preferred_name
57
+ attribute :current # true if this is the current chapter
58
+ end
59
+
60
+ sample :configuration, :for_video, <<~JSON
61
+ {
62
+ "type": "video",
63
+ "code": "e28",
64
+ "chapters": [
65
+ {
66
+ seq: 1,
67
+ preferred_name: "intro"
68
+ },
69
+ {
70
+ seq: 2,
71
+ preferred_name: "example"
72
+ },
73
+ {
74
+ seq: 3,
75
+ preferred_name: "outro",
76
+ current: true
77
+ }
78
+ ]
79
+ }
80
+ JSON
81
+
82
+ sample :configuration, :for_podcast, <<~JSON
83
+ {
84
+ "type": "podcast",
85
+ "code": "e27",
86
+ "episodes": [
87
+ {
88
+ "seq": 1,
89
+ "chapters": [
90
+ {
91
+ "seq": 1,
92
+ "preferred_name": "introduction",
93
+ },
94
+ {
95
+ "seq": 2,
96
+ "preferred_name": "scenario",
97
+ "current": true
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "seq": 2,
103
+ "current": true,
104
+ "chapters": [
105
+ {
106
+ "seq": 1,
107
+ "preferred_name": "introduction",
108
+ },
109
+ {
110
+ "seq": 2,
111
+ "preferred_name": "scenario",
112
+ },
113
+ {
114
+ "seq": 3,
115
+ "preferred_name": "story",
116
+ "current": true
117
+ }
118
+ ]
119
+ }
120
+ ]
121
+ }
122
+ JSON
123
+ end
@@ -0,0 +1,28 @@
1
+ component :project_meta_data_store do
2
+ desc "Build a JSON datastore of project files with inferred metadata."
3
+
4
+ pattern "Command"
5
+
6
+ comments <<~TEXT
7
+ - Aggregates file data from project, episode, recording, chapter, and post-produced folders.
8
+ - Infers metadata from sources like KEYWORDS, transcripts, and other relevant data.
9
+ - Creates a comprehensive JSON datastore for the entire project.
10
+ - Facilitates advanced data analysis and management for the project.
11
+ - The extracted data can be used for automated post-production processes like keyword generation, B-roll prompts, chapter names, title slides, and time code markers for calls to action.
12
+ TEXT
13
+
14
+ constructor(:parent_project)
15
+
16
+ method :run
17
+
18
+ sample :build_project_metadata, <<~RUBY
19
+ project_path = ProjectPath.new('a27')
20
+
21
+ # Instantiate the component with the parent project
22
+ metadata_store = project_meta_data_store.new(project_path)
23
+
24
+ # Execute the process to aggregate files and infer metadata
25
+ metadata_store.run
26
+ # Output: '~/video-projects/a27-ac-categorize-mp4-CI/project_metadata.json'
27
+ RUBY
28
+ end
@@ -0,0 +1,77 @@
1
+ component :project_path do
2
+ desc "Construct project path using project code and deducing state based on existing folder name."
3
+
4
+ pattern "Adapter"
5
+
6
+ comments <<~TEXT
7
+ - Infers project path based on project code and existing folder name.
8
+ - Maintains state for project code, channel code, descriptive name, keywords and episodes.
9
+ - Uses global configuration to determine root folder.
10
+ - Uses existing folder name and keywords to build internal state.
11
+ - Provides method for building absolute, relative and sub folder.
12
+ - Provides method for building new path for rename operations.
13
+ - Provides list of associated episode paths.
14
+ - Stores state in an internal data object.
15
+ - Designed for building folder names, not create or modify actual directories.
16
+ TEXT
17
+
18
+ accessors :project_code, :channel_code, :project_name, :keywords, :project_path, :episodes
19
+
20
+ method :constructor(:project_code, channel_code: nil, project_name: nil, keywords: nil)
21
+ method :instance(:folder)
22
+
23
+ method :change_path(project_code: nil, channel_code: nil, project_name: nil, keywords: nil)
24
+
25
+ sample :create_project_path, <<~RUBY
26
+ # Create a new project path
27
+ project_path = ProjectPath.new('a27', channel_code: 'ac', project_name: 'categorize-mp4', keywords: ['CI'] )
28
+ project_path.project_path # => "~/video-projects/a27-ac-categorize-mp4-CI"
29
+ project_path.project_code # => "a27"
30
+ project_path.channel_code # => "ac"
31
+ project_path.project_name # => "categorize-mp4"
32
+ project_path.keywords # => "CI"
33
+ project_path.episodes.count # => 0
34
+ RUBY
35
+
36
+ sample :infer_project_path, <<~RUBY
37
+ # Infer project path based on project code and existing folder
38
+ project_path = ProjectPath.new('a27')
39
+ project_path.project_path # => "~/video-projects/a27-ac-categorize-mp4-CI"
40
+ project_path.project_code # => "a27"
41
+ project_path.channel_code # => "ac"
42
+ project_path.project_name # => "categorize-mp4"
43
+ project_path.keywords # => "CI"
44
+ project_path.episodes.count # => 2
45
+ RUBY
46
+
47
+ sample :rename_project_path, <<~RUBY
48
+ # Rename project path
49
+ project_path = ProjectPath.new('a27')
50
+
51
+ path1 = project_path.change_path(project_code: 'a28')
52
+ path1.project_path # => "~/video-projects/a28-ac-categorize-mp4-CI"
53
+ path2 = project_path.change_path(channel_code: 'ad', project_name: 'categorize-mp4-for-appydave')
54
+ path2.project_path # => "~/video-projects/a27-ad-categorize-mp4-for-appydave-CI"
55
+ path3 = project_path.change_path(keywords: [])
56
+ path3.project_path # => "~/video-projects/a27-ac-categorize-mp4"
57
+ RUBY
58
+
59
+ sample :next_project_code, <<~RUBY
60
+ # Get next project code
61
+ project_path = ProjectPath.new('a27')
62
+ project_path.next_project_code # => "a28"
63
+
64
+ project_path = ProjectPath.new('a99')
65
+ project_path.next_project_code # => "b00"
66
+ RUBY
67
+
68
+ sample :folder_to_project_path, <<~RUBY
69
+ # Convert folder to project path
70
+ project_path = ProjectPath.instance('~/video-projects/a27-ac-categorize-mp4-CI')
71
+ project_path.project_path # => "~/video-projects/a27-ac-categorize-mp4-CI"
72
+ project_path.project_code # => "a27"
73
+ project_path.channel_code # => "ac"
74
+ project_path.project_name # => "categorize-mp4"
75
+ project_path.keywords # => "CI"
76
+ RUBY
77
+ end
@@ -0,0 +1,28 @@
1
+ component :filewatch_processor do
2
+ desc "Automate file event responses, directing new recordings to current project folders."
3
+
4
+ pattern "Observer"
5
+
6
+ comments <<~TEXT
7
+ - Monitors new eCamm recordings file events.
8
+ - Automates the process of moving new recordings to specified project folders.
9
+ - Enhances content management by ensuring recordings are organized efficiently.
10
+ - Configurable to respond to different types of file events and target folders.
11
+ TEXT
12
+
13
+ method :watch(:folder_path, :event_type)
14
+
15
+ # Will move the file to current project's recordings folder
16
+ method :move_file
17
+
18
+ sample :automate_recording_organization, <<~RUBY
19
+ config = GlobalConfig.instance
20
+
21
+ # Watch a specific folder for new and existing recordings
22
+ filewatch_processor.watch(config.folders['ecamm-recordings'], '*.mov', :moved_file)
23
+
24
+ # Example usage
25
+ # When a new file is detected in Ecamm Live Recordings, it is automatically moved to the current project's recordings folder.
26
+ filewatch_processor.move_file
27
+ RUBY
28
+ end