Compare commits

...

10 Commits

Author SHA1 Message Date
6c6c09a158 Added a license header to types.py. 2025-02-18 20:19:39 +01:00
82f8a61d16 Merge pull request '#6: Implemented the video class.' (#7) from Video_class into main
Reviewed-on: #7
2025-02-18 19:39:13 +01:00
f8e1012f3e Merge branch 'main' into Video_class 2025-02-18 19:38:46 +01:00
a3c5b350fc Added Video class to types.py. 2025-02-18 19:37:01 +01:00
0dc358d053 Merge pull request 'Added separate History class' (#5) from history-class into main
Reviewed-on: #5
2025-02-18 18:43:53 +01:00
0279f667b3 Added Video class to the diagram 2025-02-18 18:36:35 +01:00
DjMaestr0
7abf7a939f Adding history class 2025-02-18 18:29:29 +01:00
DjMaestr0
172b29e56a history-class
e Please enter the commit message for your changes. Lines starting
here is the history class
2025-02-18 18:23:24 +01:00
0a5e98f417 Added a uml diagram. 2025-02-18 18:03:34 +01:00
bdcaf3747b Merge pull request '#2: Added license headers.' (#3) from License_headers into main
Reviewed-on: #3
2025-02-18 17:50:20 +01:00
3 changed files with 1188 additions and 0 deletions

1119
design/design.gaphor Normal file

File diff suppressed because it is too large Load Diff

18
shadowtube/history.py Normal file
View File

@ -0,0 +1,18 @@
class History: #Abstract class
def __init__(self, filename):
self.history = list()
def __size__(self):
return len(history)
def parse_history(self, filename):
return history
def is_this_type(self, filename): # bool function,
return false # returns false if Youtube history
def get_video(self, index):
return history[index]
def __iter__(self):
return iter(history)

51
shadowtube/types.py Normal file
View File

@ -0,0 +1,51 @@
#
# Copyright (c) 2025 Fedir Kovalov.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
class Video:
def __init__(
self,
id: str,
title: str,
description: str,
watch_time: float,
watch_progress: float,
):
self._id = id
self._title = title
self._description = description
self._watch_time = watch_time
self._watch_progress = watch_progress
@property
def title(self):
return self._title
@property
def id(self):
return self._id
@property
def description(self):
return self._description
@property
def watch_time(self):
return self._watch_time
@property
def watch_progress(self):
return self._watch_progress