Dev plot time#6
Open
pmhalvor wants to merge 14 commits into
Open
Conversation
pmhalvor
commented
Sep 24, 2022
| content = {} | ||
|
|
||
| if data and (data.get("currently_playing_type") != "episode"): | ||
| if data and (data.get("currently_playing_type") == "track"): |
Owner
Author
There was a problem hiding this comment.
Handling podcast playbacks
pmhalvor
commented
Sep 24, 2022
Comment on lines
+19
to
+37
| def load_df(root=None, cleaned=False, end=False) -> pd.DataFrame: | ||
| if root is None: | ||
| root = ROOT | ||
|
|
||
| suffix = "_cleaned" if cleaned else "" | ||
|
|
||
| if os.path.exists(f'{root}/data/history{suffix}.csv'): | ||
| df = pd.read_csv(f'{root}/data/history{suffix}.csv') | ||
| print("loaded from", f'{root}/data/history{suffix}.csv') | ||
| else: | ||
| df = pd.read_csv(f'~/data/history{suffix}.csv') | ||
| print("loaded from", f'~/data/history{suffix}.csv') | ||
|
|
||
| max_played_at = max(df["played_at"]) | ||
|
|
||
| # get cleaned if current df is dirty | ||
| if not end: | ||
| if ("<<<<<<" in max_played_at) or (">>>>>>>" in max(df["played_at"])) or ("=======" in max(df["played_at"])): | ||
| df, max_played_at = load_df(root, cleaned=True, end=True) # break any recursivity |
Owner
Author
There was a problem hiding this comment.
Needed for safer loading/storing history locally
added 13 commits
January 8, 2023 09:09
a77f563 to
5f6c6e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
start playing with new ways to present the history data I've been gathering